Handling top level command
See original GitHub issueMaybe I’m missing something, but how do I handle the top level command?
args
.command('a', 'Import data', a)
.command('b', 'Export data', b)
This will run a or b if I run ./cmd a
or ./cmd b
.
But if I run ./cmd
, it’s hanging (cause my script opens db connection), how do I
a) print help or
b) execute some code?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Top Level Commands
MM> Top Level Commands BASIC Top-Level commands. CONTINUE - return to an unfinished SEND, after aborting or QUITting. CUSTOMIZATION commands. FILING commands.
Read more >The Top Level - Franz Inc.
A break level is exited by using one of the :pop, :prt, :continue, :restart, :return, or :reset commands, or by execution of any...
Read more >CLI Top-Level Commands - Avi Networks
CLI Top-Level Commands ; clear, Clear the statistics or value of a designated object. ; configure, Create or modify a new or existing...
Read more >What do you mean by low-level commands and high-level ...
A high-level command abstracts away a lot of the details, putting the knowledge in the tool. This normally makes them much easier to...
Read more >Top level command action does not work. #978 - GitHub
I do not think there is support for invoking the "top-level" command action handler this way when there is a sub-command as well....
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
No. I will post a reproducible example shortly.
On Sat, 29 Jun 2019 at 12:21, Marvin Mieth notifications@github.com wrote:
Here’s what I mean, taking the example from README (slightly modified):
This works fine:
But how do I make sure that the following executions print help:
I’m thinking… perhaps loop over
args.details.commands
to match sub against each command…