diff options
| author | Roy Sommer <royso@wix.com> | 2020-01-02 19:12:08 +0200 |
|---|---|---|
| committer | Roy Sommer <royso@wix.com> | 2020-01-02 19:12:08 +0200 |
| commit | b7c1dc794d4e4faa068594139e945fbeac7b02b5 (patch) | |
| tree | c63f4ee8a615bafbb735820388993cfa4635159d /README.md | |
| parent | updated pytoml (diff) | |
| download | taskipy2-b7c1dc794d4e4faa068594139e945fbeac7b02b5.zip | |
added support for passing arguments into taskipy 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: |