1 stable release
1.0.0 | Aug 27, 2024 |
---|
#125 in Value formatting
11KB
185 lines
command-unquoted
A nicer-looking Debug
implementation for Rust's std::process::Command
.
lib.rs
:
command-unquoted provides [a wrapper struct][Unquoted] for
std::process::Command
that provides a nicer-looking Debug
implementation and is useful for logs or user-facing error messages.
Instead of quoting all strings (as done in the Unix Command
implementation), quotes are added only where necessary.
As with Command
's Debug
implementation, this format only approximates an
appropriate shell invocation of the program with the provided environment.
It may be particularly unsuitable for Windows (patches welcome). Non-UTF-8
data is lossily converted using the UTF-8 replacement character. This format
is not stable and may change between releases; only the API of this
crate is stable.
To keep the resulting output friendlier (and sometimes due to Rust standard library limitations), the result of these methods are not displayed in this implementation:
Command::current_dir
Command::env_clear
andCommand::env_remove
Command::stdin
,Command::stdout
, andCommand::stderr
- all methods of all
CommandExt
traits