Giter Club home page Giter Club logo

Comments (2)

bitprophet avatar bitprophet commented on July 19, 2024

I have a partial implementation of this in master, which infers typing from the default value of arguments (both in terms of a task's argspec, and at the parser level, e.g. if anybody were to construct the parser arguments manually).

Still needs to be expanded to allow something explicit for any args that lack default values.

from invoke.

bitprophet avatar bitprophet commented on July 19, 2024

Years-later clarification: the "partial implementation" mentioned above has been a core part of the CLI framework for a long time and seems to work OK for many/most use cases; it's the functionality that knows when you have:

@task
def mytask(c, count=5):
    pass

then this invocation results in count=7 and not count="7":

$ inv mytask --count 7

Combined with boolean true-flags (--bool/--no-bool) and the recently solved #9 for lists (--mylist a --mylist b --mylist c yielding ["a", "b", "c"]) this doesn't leave much but edge cases, which deserve their own ticket(s) anyways.

Things like "no I really want SHORTER ways to supply lists" (can be solved on the user's end with split), dicts (kinda ditto, though we could possibly supply well-tested helpers for parsing eg --mydict=key=val,otherkey=otherval) and etc.

from invoke.

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.