Skip to content

Commit a37e5b2

Browse files
kiprasmelbcoe
authored andcommitted
docs: add .scriptName usage, update output to reflect actual CLI output (#44)
1 parent 462c703 commit a37e5b2

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

index.html

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,22 @@ <h1 class="pink-highlight">Yargs be a node.js library fer hearties tryin' ter pa
5959

6060
<pre>
6161
<code class="hljs language-javascript">
62-
#!/usr/bin/env node
63-
64-
require('yargs')
65-
.usage('$0 &lt;cmd&gt; [args]')
66-
.command('hello [name]', 'welcome ter yargs!', (yargs) => {
67-
yargs.positional('name', {
68-
type: 'string',
69-
default: 'Cambi',
70-
describe: 'the name to say hello to'
71-
})
72-
}, function (argv) {
73-
console.log('hello', argv.name, 'welcome to yargs!')
62+
#!/usr/bin/env node
63+
64+
require('yargs')
65+
.scriptName("pirate-parser")
66+
.usage('$0 &lt;cmd&gt; [args]')
67+
.command('hello [name]', 'welcome ter yargs!', (yargs) => {
68+
yargs.positional('name', {
69+
type: 'string',
70+
default: 'Cambi',
71+
describe: 'the name to say hello to'
7472
})
75-
.help()
76-
.argv
73+
}, function (argv) {
74+
console.log('hello', argv.name, 'welcome to yargs!')
75+
})
76+
.help()
77+
.argv
7778

7879
</code>
7980
</pre>
@@ -82,18 +83,18 @@ <h1 class="pink-highlight">Yargs be a node.js library fer hearties tryin' ter pa
8283

8384
<pre>
8485
<code class="hljs language-bash">
85-
$ example.js --help
86+
$ node example.js --help
8687
</code>
8788
</pre>
8889

8990
<div class="instructions"> To get this output: </div>
9091

9192
<pre>
9293
<code class="hljs language-bash">
93-
example.js &lt;cmd&gt; [args]
94+
pirate-parser &lt;cmd&gt; [args]
9495

9596
Commands:
96-
hello [name] welcome ter yargs!
97+
pirate-parser hello [name] welcome ter yargs!
9798

9899
Options:
99100
--help Show help [boolean]

0 commit comments

Comments
 (0)