You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My workaround is not to use isDefault and just coerce argv, for now:
// make `flint run` default commandvarflintIndex=getFlintIndex()// find where index of flint isfunctiongetFlintIndex(){letindex=0for(letargofprocess.argv){if(arg.indexOf('flint')>0)returnindexindex++}}// make sure flags are still passed to `flint run`varfirstFlag=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');}
Activity
natew commentedon Jan 6, 2016
Big +1 on this
My workaround is not to use isDefault and just coerce argv, for now:
SomeKittens commentedon Jan 6, 2016
Not sure how we'd accomplish this - you want us to skip all params if there's a default subcommand?
natew commentedon Jan 6, 2016
No, it's just to pass those options down to the subcommand.
So
flint run --cachedworks, and ifrunis default, thenflint --cachedwould work the same.SomeKittens commentedon Jan 6, 2016
My issue is what happens if the root program (
appin this case) also has a-coption.natew commentedon Jan 6, 2016
Ah, so could we have an option
isDefault: true, passOptions: truealexcanessa commentedon Sep 19, 2017
Massive +1 on this one.
To @SomeKittens's point:
If
isDefaulthas been set totrue, means that there isn't going to be any "root program".shadowspawn commentedon Aug 10, 2019
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. :-)
shadowspawn commentedon Sep 22, 2019
There are improvements on the develop branch for the next release (#614 and #1047).
shadowspawn commentedon Oct 1, 2019
v4.0.0-0 prerelease published: #1067
shadowspawn commentedon Nov 1, 2019
v4.0.0 has been released which hopefully resolves this issue