-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
Default subcommand with options #461
Comments
Big +1 on this My workaround is not to use isDefault and just coerce argv, for now: // make `flint run` default command
var flintIndex = getFlintIndex()
// find where index of flint is
function getFlintIndex() {
let index = 0
for (let arg of process.argv) {
if (arg.indexOf('flint') > 0)
return index
index++
}
}
// make sure flags are still passed to `flint run`
var firstFlag = process.argv[flintIndex + 1]
if (flintIndex === process.argv.length - 1 || (firstFlag && firstFlag[0] === '-')) {
process.flintArgs = [].concat(process.argv);
process.flintArgs.splice(flintIndex + 1, 0, 'run');
} |
Not sure how we'd accomplish this - you want us to skip all params if there's a default subcommand? |
No, it's just to pass those options down to the subcommand. So |
My issue is what happens if the root program ( |
Ah, so could we have an option |
Massive +1 on this one. To @SomeKittens's point:
If |
Took me a while to get on board with this one, but I now agree this is the correct behaviour and interested in making it happen. The PR in flight is #614, and an easy code change. :-) |
v4.0.0-0 prerelease published: #1067 |
v4.0.0 has been released which hopefully resolves this issue |
Hi, I want to use a subcommand as default, and this subcommands has options. Something like this:
This command works fine:
And this as well (executes the default subcommand):
but on execute the default subcommand with options:
I have the followin error:
The text was updated successfully, but these errors were encountered: