Hi,
The task_params
decorator does not work when the task is using basename
. The parameters are detected, but not replaced in the task parameter in python.
from doit import task_params
@task_params([{"name": "param", "short": "p", "long": "param", "default": "default"}])
def task_test1(param):
return { 'actions':[f"echo task_test1 {param}"] }
@task_params([{"name": "param", "short": "p", "long": "param", "default": "default"}])
def task_test2(param):
return { 'basename': 'test_other', 'actions':[f"echo task_test2 {param}"] }
> doit -v2 test1 --param p1 test_other --param p2
. test1
task_test1 p1
. test_other
task_test2 default
> doit -v2 test_other --invalid p2
ERROR: Error parsing Task: option --invalid not recognized (parsing options: [CmdOption({'name':'param', 'short':'p','long':'param' })]). Got: ['--invalid', 'p2']
Environment
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too