pydoit / doit

CLI task management & automation tool
http://pydoit.org
MIT License
1.84k stars 175 forks source link

Allow custom `TaskLoader2.load_tasks` to consume arguments #442

Open ktbarrett opened 1 year ago

ktbarrett commented 1 year ago

From here. The remaining arguments not parsed by the Command are passed to the TaskLoader. This would be a nice opportunity for the TaskLoader to be able to consume/modify arguments before the arguments are parsed by the main program.

Proposal

Allow the result of the TaskLoader2.load_tasks to be either List[Task] or Tuple[List[Task], List[str]] where in the tuple case the second result would be arguments.

Alternatives

Right now it's possible to mutate the passed in the argument list to get the desired effect. That is obviously not intended.

Fund with Polar

schettino72 commented 1 year ago

@ktbarrett could you please provide an example.