Passing arguments to tasks: need to specify at least one of short or long?
See original GitHub issueHey, thanks for this great tool! I just came across the following issue: For passing arguments to tasks, the documentation specifies that “short” and “long” names are optional. However, in my setup it seems as if omitting both gives an error.
dodo.py:
def task_py_param():
def show_param(param):
print(param)
return {'actions':[(show_param,)],
'params':[{'name':'param',
'default':'default value'}],
'verbosity':2,
}
Running the task:
$ doit py_param --param=test
ERROR: Error parsing Task: option --param not recognized (parsing options: ['--param=test'])
$ doit help py_param
py_param
Versions:
$ python --version
Python 3.4.0
$ pip list
doit (0.28.0)
pip (1.5.4)
pyinotify (0.9.6)
setuptools (2.1)
six (1.9.0)
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Task parametrization, getting arguments from command line
It is possible to pass option parameters to the task action through the command ... It can optionally define a “short” and “long”...
Read more >Ruby - how to pass a single argument to a method with long ...
For instance, I want to pass ignoreAlreadyCrawled = true in the method below, and use the default parameter values for everything else. But ......
Read more >Adding arguments and options to your Bash scripts - Red Hat
Try putting the parameters in a different order to see how that works. These parameters are positional, and that is a key consideration....
Read more >Invoking tasks
Note that both long and short style flags are supported, and that equals signs are ... List values (which you wouldn't want to...
Read more >Usage | Task
You can use env to set custom environment variables for a specific task: version: '3' ... If you want a variable in an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@schettino72 - I am running into a similar situation when passing parameters through a yield statement instead of return. The documentation only gives examples of passing parameters in one-off tasks with return statement, whereas I am running a task with for loop through a bunch of data and using a yield statement in order to capture the task actions, targets, dependencies, etc. However, I am now trying to add parameters to this task:
This is my yield definition:
You can disregard the
log_status
, I have built a custom logger to log tasks. Read the yield statement as the sub-dictionary ofvalue
.Cool, so give it a 🌟 😬