first commit
This commit is contained in:
10
source/app.js
Normal file
10
source/app.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import {Text} from 'ink';
|
||||
|
||||
export default function App({name = 'Stranger'}) {
|
||||
return (
|
||||
<Text>
|
||||
Hello, <Text color="green">{name}</Text>
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
24
source/cli.js
Normal file
24
source/cli.js
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
import React from 'react';
|
||||
import {render} from 'ink';
|
||||
import meow from 'meow';
|
||||
import App from './app.js';
|
||||
|
||||
const cli = meow(
|
||||
`
|
||||
Usage
|
||||
$ dash-cli
|
||||
|
||||
Options
|
||||
--name Your name
|
||||
|
||||
Examples
|
||||
$ dash-cli --name=Jane
|
||||
Hello, Jane
|
||||
`,
|
||||
{
|
||||
importMeta: import.meta,
|
||||
},
|
||||
);
|
||||
|
||||
render(<App name={cli.flags.name} />);
|
||||
Reference in New Issue
Block a user