printable_shell_command/
shell_printable.rs1use std::str::Utf8Error;
2
3pub trait ShellPrintable {
4 fn printable_invocation_string(&self) -> Result<String, Utf8Error>;
5 fn printable_invocation_string_lossy(&self) -> String;
7
8 fn print_invocation(&mut self) -> Result<&mut Self, Utf8Error> {
10 println!("{}", self.printable_invocation_string_lossy());
11 Ok(self)
12 }
13 fn print_invocation_lossy(&mut self) -> &mut Self {
15 println!("{}", self.printable_invocation_string_lossy());
16 self
17 }
18}