Default subcommand with options
See original GitHub issueHi, I want to use a subcommand as default, and this subcommands has options. Something like this:
//app.js
program
.command('run', 'Execute stuff', {isDefault: true})
.command('list', 'List stuff')
.parse(process.argv);
// app-run.js
program
.option('-c, --config <file>', 'use a config file')
.parse(process.argv);
This command works fine:
app run -c config.json
And this as well (executes the default subcommand):
app
but on execute the default subcommand with options:
app -c config.json
I have the followin error:
error: unknown option `-c'
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:10
Top Results From Across the Web
Default subcommand · Issue #975 · clap-rs/clap - GitHub
In my scenario I am not concerned about confusion with the arguments of the parent command as I only have the default help/options...
Read more >How do I specify default subcommand? - Stack Overflow
Following doesn't work because it runs callable that doesn't have implementation. @Command( name = "tool", mixinStandardHelpOptions = true, ...
Read more >Subcommands and the App · CLI11 Tutorial
Subcommands are keyword that invoke a new set of options and features. ... The default is CLI:::FailureMessage::simple , and you can easily define...
Read more >Clikt - Common Options With Subcommands
This allows you to specify all options after the subcommand name. ... Options:") { val token by option(help="api token to use for requests").default("....
Read more >Clap - Default Subcommand? : r/rust - Reddit
I've made a bit of a workaround by adding options to the main app which are then hidden, but there is no indicator...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
v4.0.0-0 prerelease published: #1067
v4.0.0 has been released which hopefully resolves this issue