Comments (7)
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
Well, I found this in the API docs:
By default, the parse() method stops as soon as it reaches -- by itself or anything that the parser doesn't recognize as an option, flag, or option value. If arguments still remain, they go into ArgResults.rest.
Which looks like it can help me today.
from args.
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
After playing around the -- doesn't help me because the tools generate the command-line, and they don't put their args after --.
So I think I need a "ignore unspecified args" option for ArgParser.
from args.
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
Will you accept a patch for such a feature?
cc @munificent.
from args.
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent
Args has an option now to ignore unspecified arguments, but not unrecognized options. The former lets you have options that appear after non-option arguments. For example:
$ myapp some/file.txt --option
Args can skip over some/file.txt and parse --option. But it doesn't do that for things that look like options (i.e. a leading "-").
I'd be fine with a patch for the latter too, provided it was an opt-in feature. I'm thinking add a "ignoreUnknownOptions" argument to parse().
from args.
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
Thanks Bob. ignoreUnknownOptions as an opt-IN would work. Good to know you'd accept a patch. :)
from args.
<img src="https://avatars.githubusercontent.com/u/3276024?v=3" align="left" width="48" height="48"hspace="10"> Comment by anders-sandholm
Removed Library-Args label.
Added Pkg-Args label.
from args.
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
Now at #9
Added MovedToGithub label.
from args.
Related Issues (20)
- expose interface for completion HOT 2
- Overhaul usage errors to not use exceptions
- Examples for CommandRunner aren't correct on pub page HOT 3
- Statically typed argument parser (possibly with code generator)? HOT 3
- Add a CommandRunner example HOT 2
- Why is `CommandRunner._usageWithoutDescription` private?
- Promote Command.argResults to be non-nullable HOT 1
- Make allowed options case insensitive
- How to add default command?
- Provide the function to print strings in nice columns
- Standards used in docopt. HOT 2
- [Feature request] Show command alias in usage HOT 3
- Command CommandRunner Platform.executableArguments HOT 3
- use of 'mandatory' options breaks handling of the help flag
- Feature request: parse complete command string to List<String> args HOT 3
- Analogue of '::' GNU getopt extension? HOT 1
- `--` needs to be escaped on Windows HOT 2
- Usage should be able to show additional info for trailing options (rest) HOT 1
- Setting the mandatory parameter of the addOption function to true has no effect. HOT 2
- `takesArguments` should change the usage text
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 args.