Let's say that I'm configuring yargs like so:
var argv = require('yargs')
.usage('Usage: $0 <sourceDir>')
.demand(1)
.argv;
How would I .describe the sourceDir argument?
This similar issue discussed positional arguments to commands, but note that I am not using a command here, but rather would like to describe a top-level positional argument.
@wearhere we've been talking about adding top-level commands, which I think could address this issue well.
@bcoe How is the progress of this issue?
@bcoe +1 for this
this is now possible with default commands and .positional() 馃帀
var argv = require('./')
.usage('$0 <source-dir>', 'performs operation on source-dir', (yargs) => {
yargs.positional('source-dir', {
describe: 'this is the source directory'
})
})
.demand(1)
.argv;
console.info(argv)
Most helpful comment
@wearhere we've been talking about adding top-level commands, which I think could address this issue well.