Add ability to specify a default subcommand
See original GitHub issueJust like now
running now deploy
by default, we could add the ability to specify a default subcommand.
Maybe like this:
.defaultCommand('deploy', 'Deploy')
or
.command('deploy', 'Deploy', { defaultCommand: true }
or via the options
in .parse(process.argv, { defaultCommand: 'deploy' }
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
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 >Default sub-command · Issue #41 · alecthomas/kong - GitHub
I'm aiming to have a command with subcommands where there is a default subcommand when no subcommand is entered on the command line....
Read more >Defining Commands and Subcommands | Documentation
Start by defining the root Math command. You can provide a static configuration property for a command that specifies its subcommands and a...
Read more >clap::AppSettings - Rust - Docs.rs
Displays the arguments and SubCommand s in the help message in the order that they were declared in, and not alphabetically which is...
Read more >Sub-parsers - Real Python
A sub-parser gives you the ability to write commands within your script. ... I'll be using this default argument to invoke my subcommand...
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 FreeTop 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
Top GitHub Comments
@jcurtis
args.sub
returns an array of all subcommands fromprocess.argv
. e.g.Does that help?
The default command should be the code contained within the main binary. If you need an alias for that, simply define a new command and make it load the main binary.
You can define it in the
init
function here.