Git Product home page Git Product logo

Comments (4)

sandreas avatar sandreas commented on August 25, 2024 1

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.

Tyrrrz avatar Tyrrrz commented on August 25, 2024 1

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.

Tyrrrz avatar Tyrrrz commented on August 25, 2024

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.

Tyrrrz avatar Tyrrrz commented on August 25, 2024

Descoping this

from clifx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.