pub struct Style { /* private fields */ }Expand description
This is a builder for various settings of how command may be printed
Use format!("{}", cmd.display(style)) to actually print a command.
Implementations§
Source§impl Style
impl Style
Sourcepub fn debug() -> Style
pub fn debug() -> Style
Create a new style object that matches to how fmt::Debug works for
the command
Sourcepub fn short() -> Style
pub fn short() -> Style
Create a simple clean user-friendly display of the command
Note: this kind of pretty-printing omit many important parts of command and may be ambiguous.
Sourcepub fn env(self, enable: bool) -> Style
pub fn env(self, enable: bool) -> Style
Toggle printing of environment
When false is passed we only show environ[12], i.e. a number of
environment variables. Default is true for Style::debug
constructor.
This method does nothing when using Style::short construtor
Sourcepub fn path(self, enable: bool) -> Style
pub fn path(self, enable: bool) -> Style
Toggle printing of full path to the executable
By default we don’t print full executable path in Style::short mode.
Note: if this flag is disabled (default) we only show a name from
arg0, instead of executable path. When flag is
enabled, the arg0 is shown alongside with executable path in
parethesis if the values differ.
This method does nothing when using Style::debug constructor