context.run(): Expose API to pass command and separate args instead of a single string
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Begin at context.run(command: str, **kwargs: Any) and trace Invoke's command-spawning path. Compare the current single-string contract with the proposed separate command-and-arguments API, including whitespace and quote handling. Done means the API behavior is defined and tested for paths like the example; no file or test names are provided.
Written by the indexing model from the issue text.
Description
Currently context.run(command: str, **kwargs: Any) gives very limited chances to the user when dealing with paths with whitespaces or special chars.
mkdir "123\ foo\ \"bar"
Imagine that folder whose name contains whitespaces and double quote symbol. Passing it as argument to a shell command within a interpolated string is basically hell.
In Rust and Node you can spawn a separate command by specifying the command itself and then each argument separately (into an array of strings). This is very convenient to NOT having to deal with string interpolation. Example:
child_process.spawnSync(command, [ args ], ...);
However in Invoke all command arguments must be interpolated into a single command string. I don't know if this is a Python limitation. I just hope that Python exposes an API to specify the command and each separate argument to spawn. And if so, IMHO it would make sense that Invoke exposes it.
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinvoke/invoke
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100