Skip to content

Combination of click and switch command in poe #154

Answered by nat-n
amirhessam88 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @amirhessam88,

I would expect using double quotes in the task definition to generally do what you want. The cmd task is intended to closely emulate bash syntax. There are some edge cases where it fails (because currently it relies on shlex which is too simplistic), but I'm actually working on a new parser at the moment to make it more robust and shell like.

Is there anything you can't achieve by defining the tasks like so?

# pyproject.toml based on your solution 

[tool.poe.tasks.run]
control.expr = "pipeline"
args = ["pipeline", "foo", "bar", "baz"]

[[tool.poe.tasks.run.switch]]
case = "p1"
cmd = """python -m pipelines.p1 --foo "${foo}" --bar "${bar}" """

[[tool.poe.tasks.run.switch]…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@amirhessam88
Comment options

@amirhessam88
Comment options

@nat-n
Comment options

Answer selected by amirhessam88
@amirhessam88
Comment options

@RoyerRamirez
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #153 on June 27, 2023 19:18.