Comments (6)
True. This isn't common, however, changing this will not only break existing code (which may be acceptable in some cases, using the [Obsolete] attribute for example), it will break existing apps. Breaking existing apps affects users of the app instead of developers and this is not acceptable.
For example, if one has a script with the following lines:
myexe login -user=john -pass=foobar
Unless a developer updates the myexe code, the script will no longer work.
Thanks for the suggestion. I may consider a "CLAP2" and have this supported.
from clap.
I agree. First I forgot another benefit: The arguments end market: mycmd --foo foo -- --this-is-a-file -another-one
There are still solutions:
- Flag to support "-help" => "-h -e -l -p"
- Major version with clear backward incompatible changes (much cleaner).
from clap.
Can you please elaborate more on the "end market" you mentioned?
I'm not sure I understand this line:
mycmd --foo foo -- --this-is-a-file -another-one
from clap.
Everything after a " -- " will never be interpreted as a named parameter. Other than that, it has no effect.
For example both are equivalent:
mycmd --arg1 ok foo-file bar-file
mycmd --arg1 ok -- foo-file bar-file
It's useful when you want to make sure that file names that possibly start by "-" or "--" will not be interpreted as optional parameter values. For example this is different
mycmd --arg1 ok --arg1 # Interpreted as argument named "arg1"
mycmd --arg1 ok -- --arg1 # Interpreted as unnamed argument "--arg1"
It might not seem that useful at first but for example I use msysgit on Windows. Meaning I can call: find ... | xargs mycmd -arg1 ok --
which would be safer.
NDesk.Options supports that notation.
from clap.
I would also like to see this.
Or rather the full GNU style standard since I'm porting some Unix based tools to .Net and need to follow that convention. But I'm putting this here rather than creating a new issue. The minimum would be:
--long-option # for long option names
-s # for short option names
-abc # for multiple short options without arguments (one character per option)
-s arg # short option with argument
--long arg # long option with argument
I found this project when looking for a verb based parser since I also need to be able to do something like git or mercurial:
git [verb] [verb specific options]
If you want, you could check the gnu getopt documentation although I personally find the POSIX specification a bit easier to digest.
You have some great code going on here. Maybe it would be enough to create an alternate parser with different rules. Besides, the default behavior can remain totally the same so no implementations are broken.
Would you be interested in any contributions regarding this?
from clap.
It was a long time since my last contribution to the project. I actually considered it "done" (only bug fixing).
Answering your question - yes, I would very much be interested in any contributions.
Thanks,
Adrian
from clap.
Related Issues (20)
- Multiple apps and help - how to call? HOT 4
- Merge #24 break when an exception is not serializable HOT 2
- Allow sequence of Verbs HOT 2
- Allow [DirectoryExists], [FileExists], [PathExists] to be applied to global parameters HOT 3
- Help text of parameters not displayed HOT 3
- Error attribute is ignored when RunConsole is used HOT 2
- .pdb file is included in nuget package HOT 4
- Required property on ParameterAttribute not working HOT 1
- Remove Windows.Forms Dependency HOT 3
- Strong name assemblies HOT 3
- Help isn't being shown HOT 2
- Correctly bubbling exit-codes HOT 2
- couldn't make it work HOT 2
- Add support for Argument Models HOT 3
- Feature Request: Interactive REPL shell support HOT 1
- Simpler scenarios support HOT 1
- Create base exception class for all CLAP exceptions HOT 2
- Parameter Help format HOT 1
- [PreVerbExecution] method not called for [Empty] verb
- How can I create such an awesome website? HOT 1
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 clap.