-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to specify that a named argument should access multiple va…
…lues (#70) Also improve tests for executing on windows The new `multiple` option can be added to args to make them accept multiple values. - only the last positional arg may have multiple set - multiple option defaults to false - args of type boolean may not have the multiple option set - if `multiple = true` and `required = false` then the result is `nargs="*"`, or if `required = true` then `nargs="+"` - an integer value >= 2 may also be given to specify an exact number of values are required for an arg - for script tasks the values are passed as a list, for command tasks they can be templated into the command (thus potentially passed as multiple arguments), shell tasks don't have any special support. - All tasks also get the list of values as an env var in the form of a space delimited string
- Loading branch information
Showing
32 changed files
with
432 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
tool.poe.tasks.show_env = "env" | ||
tool.poe.tasks.show_env = "poe_test_env" | ||
|
||
[tool.poe.tasks.echo] | ||
cmd = "echo POE_ROOT:$POE_ROOT ${BEST_PASSWORD}, task_args:" | ||
cmd = "poe_test_echo POE_ROOT:$POE_ROOT ${BEST_PASSWORD}, task_args:" | ||
help = "It says what you say" | ||
env = { BEST_PASSWORD = "Password1" } | ||
|
||
[tool.poe.tasks.greet] | ||
shell = "echo $formal_greeting $subject" | ||
shell = "poe_test_echo $formal_greeting $subject" | ||
args = ["formal-greeting", "subject"] | ||
|
||
[tool.poe.tasks.surfin-bird] | ||
cmd = "echo $WORD is the word" | ||
cmd = "poe_test_echo $WORD is the word" | ||
env = { WORD = "${SOME_INPUT_VAR}"} | ||
|
||
[tool.poe.tasks.multiple-value-arg] | ||
cmd = "poe_test_echo \"first: ${first} second: ${second}\"" | ||
|
||
[[tool.poe.tasks.multiple-value-arg.args]] | ||
name = "first" | ||
positional = true | ||
|
||
[[tool.poe.tasks.multiple-value-arg.args]] | ||
name = "second" | ||
positional = true | ||
multiple = true | ||
type = "integer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
verbosity = 1 | ||
|
||
[tool.poe.tasks] | ||
test = "echo Hello there!" | ||
test = "poe_test_echo Hello there!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.