Is it possible to use 'generic' value as the default command?
See original GitHub issueLet me try to explain.
I have this CLI:
my-cli something-else
my-cli -h
I want to be able to use what I want as the first argument. Something like this:
// Instead of:
.command('build <entry>')
// just:
.command('<entry>')
is that clear?
A more real example:
prog
.command('<entry>')
.describe('List your entries')
.option('a, --add')
.action((entry, opts) => {
console.log('You said:')
console.log(entry)
})
I need to be able to run my-cli hello
and not only using my-cli a hello
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
c# - Anyway to default a generic parameter to a certain type?
I don't believe there is a way to default it to a certain type, but you could put that ...
Read more >When to set defaults for VHDL generics
It's good practice to always mention a default value to generic during entity declaration because it makes sure that the entity can be ......
Read more >Unable to specify a default value for a generic parameter #3737
I think the problem here is that in general, e.g. if there are other parameters also using _T in their type, the default...
Read more >value expressions - produce the default value for any type
Use the default value expressions to obtain the default, uninitialized value of a type. The default value expression can be used with generic...
Read more >GenericValue Variables - UiPath Documentation Portal
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted to String...
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
My solution to this problem:
Heh, ended up migrating to https://github.com/tj/commander.js/
It has variadic arguments. Didn’t mess up with my CLI help text. Nice.