Open amarzavery opened 6 years ago
Use function form of builder
// my-module.js
exports.command = 'get <source> [proxy]'
exports.describe = 'make a get HTTP request'
exports.builder = (yargs) => {
yargs
.option('banana', { default: 'cool' })
.option('batman', { default: 'sad' })
.example('$0 get https://google.com')
}
exports.handler = function (argv) {
// do something with argv.
}
As mentioned in the example for specifying individual commands in a specific file over here.
How can one provide an example for this specific command?
I tried to provide an example based on a sample provided for yargs over here with
.example()
where the first item is the command and the second item in the array is the example description.
However that did not work. Any idea as to how can one provide examples for commands defined in an individual file?