Comments (4)
I generally wanted to limit alternative ways of doing the same thing.
Perfectly fine. Your library is just an awesome piece of software and I can tell that not only reading your docs or answers, but also by reading your API methods and your code. Very professional - I also like CliWrap
very much.
The space delimited syntax seems more common and in some cases also more powerful.
Absolutely.
For example, you can specify multiple values with
--parameter value1 value2 value3
, how would you do the same with equals sign?
My best bet would be --parameter=value1 --parameter=value2 --parameter=value3
not having a possibility to prevent multiple repetitions of --parameter
. I also saw things like --parameter=value1,value2,value3
combined with a separator char attribute (CommandOption("parameter", "p", ",")
), but i don't like this approach, because if you would like to provide a real ,
, you have to work with escaping, etc.
One problem I really see with the current approach is user expectations combined with the error message when using =
. I wrote a little tester
app and called it like this:
./tester tag --meta-title="my title"
and got
Unrecognized option(s):
--meta-title=my title
tester v1.0.0
USAGE
dotnet tester.dll tag [options]
OPTIONS
--meta-title Default: "".
-h|--help Shows help text.
It took me a while to understand, that =
is not supported, that the error points me to the unrecognized option --meta-title=my title referring the whole thing as ONE option, not as option with parsed value. I first thought, that the library had a parsing issue. It just looks strange to see --meta-title=my title
unrecognized and later on there is --meta-title
in the usage instructions :-)
Maybe it would be helpful to extend the error message, if there is an =
used in an option like this:
Unrecognized option(s):
--meta-title=my title (Please note, that = is not supported as option separator)
Don't get me wrong, the library is perfectly usable as is. If everyone else hat implemented it as clean as you did (without =
support), I would not have been suprised, that =
is not supported :-)
from clifx.
Thanks!
Yeah, that's a good idea. Maybe if the supplied argument contains an equals sign, we can provide an additional hint.
Alternatively we can just extend that error messages with an example of how options should be formatted.
from clifx.
I don't have a very strong argument against it, but I generally wanted to limit alternative ways of doing the same thing. The space delimited syntax seems more common and in some cases also more powerful.
For example, you can specify multiple values with --parameter value1 value2 value3
, how would you do the same with equals sign? I know different parsers take different approaches here.
from clifx.
Descoping this
from clifx.
Related Issues (20)
- Add IConsole.Clear()
- Separation of model from business logic HOT 7
- Check `BindingConverter<T>` and `BindingValidator<T>` types in analyzers
- Executable name does not appear in help text in some terminals HOT 4
- How do you wrap help output? HOT 1
- Add multi-language output message support HOT 5
- Command examples HOT 3
- Drop support for targets below net5.0 HOT 11
- Positional arguments listed out-of-order when inheriting from base command class HOT 2
- ConsoleWriter is not thread-safe HOT 1
- `IConsole.ReadKey` should return the key that was read HOT 1
- Assembly binding confusion results in many AD0001 analyzer warnings HOT 11
- `FakeInMemoryConsole.Clear()` has no effect HOT 4
- Capturing Trace and Debug output HOT 1
- Default `IsRequired` for options based on whether the `required` modifier is used on the property
- CliFx.Analyzers produces hundreds of CS8032 warnings in build HOT 9
- Publishing an exe as "PublishSingleFile=true" with version 2.3.4 fails HOT 2
- Calling commands from other rcommands HOT 3
- Allow the non scalar parameter to be optional or have default value HOT 4
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 clifx.