Format a command so it can be copied into a shell. Similar to `shlex.join`, but also accepts arguments which are Paths, or a single string/Path outside of a list.
(args: str | Path | ArgsT)
| 119 | |
| 120 | |
| 121 | def join_command(args: str | Path | ArgsT) -> str: |
| 122 | """Format a command so it can be copied into a shell. |
| 123 | |
| 124 | Similar to `shlex.join`, but also accepts arguments which are Paths, or a |
| 125 | single string/Path outside of a list. |
| 126 | """ |
| 127 | if isinstance(args, (str, Path)): |
| 128 | return str(args) |
| 129 | else: |
| 130 | return shlex.join(map(str, args)) |
| 131 | |
| 132 | |
| 133 | def print_env(env: EnvironmentT) -> None: |
no test coverage detected
searching dependent graphs…