Comments (2)
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.
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)
- Add support for argument choices, like argparse
- AmbiguousEnvVar when setting default runner.env with both lower and uppercase HOT 1
- 2.0.0: pytest is failing in tests/runners.py units HOT 8
- 2.1.0 finds it suddenly unable to find the tasks directory HOT 9
- 2.1 has no decorator HOT 3
- Import is resolving the wrong module HOT 2
- after an upgrade to ubuntu 23.04 (python 3.11), invoke can no longer import external modules HOT 2
- MockContext does not support asynchronous HOT 2
- Invoke 2.1.0 / 2.1.1 is not able to read invoke.yaml configuration file HOT 10
- Add __all__ to __init__.py
- task decorator is wrongly typed HOT 3
- Improve types of context.run HOT 2
- types of context.config is not correct HOT 3
- `add_collection()` is missing the `ModuleType` in the type-hints HOT 1
- How do I read the current output with asynchronous without waiting for the process to finish? HOT 1
- Regex support for MockContext is broken?
- `paramiko.ssh_exception.SSHException: Channel is not open` when chaining invoke tasks
- invoke 2.1.3 does not work when run inside bash
- 2.2.0: sphinx warnings `reference target not found`
- Document adding print-completion-script to venv
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke.