Given a command, print it in a both machine and human readable way. Args: *args: the list of command line arguments you want to run env: the dictionary of environment variable settings for the command
(args: Sequence[str])
| 18 | |
| 19 | |
| 20 | def log_command(args: Sequence[str]) -> None: |
| 21 | """ |
| 22 | Given a command, print it in a both machine and human readable way. |
| 23 | |
| 24 | Args: |
| 25 | *args: the list of command line arguments you want to run |
| 26 | env: the dictionary of environment variable settings for the command |
| 27 | """ |
| 28 | cmd = " ".join(shlex.quote(arg) for arg in args) |
| 29 | logging.info("$ " + cmd) |
| 30 | |
| 31 | |
| 32 | K = TypeVar("K") |