Giter Site home page Giter Site logo

argvard's People

Contributors

andlima avatar dasich avatar untitaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

untitaker andlima

argvard's Issues

Ability to show usage help on main

Currently argvard forces the user to define a main function, and do something useful in it. However, i have the situation where i can't do anything meaningful in main(), so i want to display the help there and exit with code 1. Currently i do this in main:

app.options['--help'].function(context)

but it would be nice to do this in a documented way. I see two options:

1.) define a default main function which does exactly that (in other words, don't force the user to define a main function)
2.) define an API for showing the help and exiting with code 1.
3.) Both.

Make "context" a thread local?

  1. insert any general pros and cons about threadlocals
  2. Currently there is no way to get the context from a type callable which was passed to an annotation. But having an explicit context arg there destroys the "purity" of the API IMO.

Allow invoking options/commands relative to the currently executed option/command

I'd like to make it possible to invoke options and commands by providing an API like delegate(context, argv). In this case argv could be something like ['--help'] to call the help function but one could also include arguments or make more complicated calls like [command --option argument].

Fundamentally this would call __call_ with the current context skipping any setup code.

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.