Giter Club home page Giter Club logo

Comments (2)

HuwCampbell avatar HuwCampbell commented on July 1, 2024

I've written up a little piece on version options.

https://github.com/pcapriotti/optparse-applicative/wiki/Version-Options

In essence you're free to use an alternative if you want to. Personally I find

foo-bar ([--delete] [-v|--verbose]) |  --version

a bit heavy. Also means one can't just chuck a --version in anywhere and have it work.

from optparse-applicative.

andreasabel avatar andreasabel commented on July 1, 2024

Thanks for the pointer.
In your wiki article, an alternative Version in the Command type is required.
However, since infoOption is "a parser that always fails" and just outputs a message, would it make sense that I do not need to declare an alternative (which is anyway never chosen since the parser fails)---so I could get the same convenience as with infoOption.

In the line with the OP, note that the current conjunctive handling of infoOption does not match the mathematical expectation. If the infoOption parses the empty type (0) since the parser fails, disjunctively you get A + 0 = A, so you can add the empty alternative without losing your other options A, but A * 0 = 0...

from optparse-applicative.

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.