Skip to content

Commit

Permalink
docs: switch to using .positional() in example (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Oct 14, 2017
1 parent 280d0d6 commit 1598a7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -56,11 +56,12 @@ Retreat from the xupptumblers!
```js
#!/usr/bin/env node
require('yargs') // eslint-disable-line
.command('serve', 'start the server', (yargs) => {
yargs.option('port', {
describe: 'port to bind on',
default: 5000
})
.command('serve [port]', 'start the server', (yargs) => {
yargs
.positional('port', {
describe: 'port to bind on',
default: 5000
})
}, (argv) => {
if (argv.verbose) console.info(`start server on :${argv.port}`)
serve(argv.port)
Expand Down

0 comments on commit 1598a7f

Please sign in to comment.