We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a command with subcommands and one of them is default, see
const options = yargs .command(['export'], 'Do export', yargs => yargs .command(['csv', '*'], 'Export to CSV', { 'value': { demandOption: true } }) .command('html', 'Export to HTML', { 'value': { demandOption: true } }) .demandCommand(1) ) .command(['import'], 'Do import', { 'value': { demandOption: true } }) .help().strict(true).demandCommand(1) .parse();
When a user types wrong subcommand, then the help is wrong:
$ node index.js export foo Export to CSV Commands: index.js export export Do export index.js export import Do import ...
When I remove '*', i.e. the default command flag, from the csv command, then the help is OK:
'*'
csv
$ node index.js export foo Do export Commands: index.js export csv Export to CSV index.js export html Export to HTML ...
The text was updated successfully, but these errors were encountered:
$0
fix: address display bug with default sub-commands (#2303)
9aa2490
Fixes #2291, #2247
@xmedeko a fix for this should now be available in yargs@ 17.7.1.
yargs@ 17.7.1
Sorry, something went wrong.
No branches or pull requests
I have a command with subcommands and one of them is default, see
Actual
When a user types wrong subcommand, then the help is wrong:
Expected
When I remove
'*'
, i.e. the default command flag, from thecsv
command, then the help is OK:The text was updated successfully, but these errors were encountered: