Comments (6)
Yep, good catch.
Regarding flags, CLI parse explicitely tells minimist it expects a boolean value, so it's correctly handled.
The correct behaviour would be indeed to return an error if a boolean is given where another value was expected.
If you can submit a patch for this, that would be perfect. Else I'll try to find time.
from cliparse-node.
Do you know where the right place to fix this is? I took a guess and it fixes my concern but it causes 5 tests to fail, so that's likely not the best solution.
master...chrishiestand:missing-option-error
from cliparse-node.
I guess it has to happen inside the parsers themselves, as some parsers (ie the boolean parser) have to accept no value being given (see my commit).
Another solution would be to add a boolean flag in the parser API to let a parser declare if it accepts empty values.
Neither solution please me that much, tbh. The auto-casting behaviour of minimist is a bit of a problem in this case. Regular strings would be much simpler, I'll see what I can do to turn it off.
from cliparse-node.
I'll take a shot with https://github.com/substack/minimist/issues/32 once I'm in my plane.
from cliparse-node.
@chrishiestand I think #20 will improve things, I'll release a version later today, so if you still have the issue, don't hesitate to check it out :-)
from cliparse-node.
Thanks @divarvel. I'll close this issue for now.
from cliparse-node.
Related Issues (12)
- Display an error if a non existing option is given to a command HOT 1
- wishlist: help command should show default values HOT 5
- Flag aliases are not taken into account
- Discarded option values
- Arguments not parsed correctly if the binary is nodejs
- Add a --version flag HOT 2
- Autocompletion improvement using tabtab HOT 1
- Ownership transfer to Clever Cloud HOT 4
- Support for variadic arguments
- Cleaner display of errors
- Dedicated ZSH completion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cliparse-node.