diff options
| author | Roy Sommer <illBeRoy@users.noreply.github.com> | 2020-01-02 19:25:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-02 19:25:03 +0200 |
| commit | 81b17bde80cff6765f9c419965ea93d80814614f (patch) | |
| tree | c63f4ee8a615bafbb735820388993cfa4635159d /README.md | |
| parent | updated pytoml (diff) | |
| parent | added support for passing arguments into taskipy tasks (diff) | |
| download | taskipy2-81b17bde80cff6765f9c419965ea93d80814614f.zip | |
Merge pull request #2 from illBeRoy/pass-arguments-to-task
Support Passing Command Line Arguments Into Tasks
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -54,6 +54,23 @@ In order to run a task, run the following command in your terminal: poetry run task test ``` +### Passing Command Line Args to Tasks +If you want to pass command line arguments to tasks (positional or named), simply append them to the end of the task command. + +For example, running the above task like this: +```bash +poetry run task test -h +``` + +Is equivalent to running: +```bash +python -m unittest tests/test_*.py -h +``` + +And will show unittest's help instead of actually running it. + +> ⚠️ Note: if you are using pre \ post hooks, do notice that arguments are not passed to them, only to the task itself. + ### Composing Tasks #### Grouping Subtasks Together Some tasks are composed of multiple subtasks. Instead of writing plain shell commands and stringing them together, you can break them down into multiple subtasks: |