Giter VIP home page Giter VIP logo

Comments (5)

keleshev avatar keleshev commented on July 30, 2024

Agree. That is definitely a TODO. And should be quite easy—docopt knows which elements it didn't match ("left" elements).

from docopt.

johari avatar johari commented on July 30, 2024

@halst What errors do you think can occur while parsing the usage message? For example, should it complain when it fails to find "usage:"? or when program name is not consistent in different usage lines?

from docopt.

keleshev avatar keleshev commented on July 30, 2024

@johari yes, something like this. Python version already complains if there is no "usage:" or if there is more than one "usage:".

When we switch to the new grammar (#104) we will be able to report syntax errors as well.

from docopt.

benoistlaurent avatar benoistlaurent commented on July 30, 2024

On the same topic, I think the "Unrecognized option" primitive should be extended to commands and arguments.
Wouldn't it be nice too to make a choice about the -h, --help option?
Right now, this option is valid but does not appear in the command line if programmer didn't write it.
Don't you think it's a bit obscure and docopt should either automatically add this option or do not provide it at all if the user didn't write it down?

from docopt.

keleshev avatar keleshev commented on July 30, 2024

@benoistlaurent agree, this is on my todo-list. Next release will be non-backwards-compatible, so this change should be fine.

from docopt.

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.