[−][src]Trait fluvio_command::CommandExt
Adds useful extension methods to the Command type
Required methods
fn inherit(&mut self) -> &mut Self[src]
Inherit both stdout and stderr from this process.
Example
use std::process::Command; use fluvio_command::CommandExt; let _ = Command::new("echo") .arg("Hello world") .inherit() .status();
fn display(&mut self) -> String[src]
Return a stringified version of the Command.
use std::process::Command; use fluvio_command::CommandExt; let mut command = Command::new("echo"); command.arg("one").arg("two three"); let command_string: String = command.display(); assert_eq!(command_string, "echo one two three");
fn result(&mut self) -> CommandResult[src]
Returns a result signaling the outcome of executing this command.
use std::process::{Command, Output}; use fluvio_command::{CommandExt, CommandErrorKind}; // On success, we get the stdout and stderr output let output: Output = Command::new("true").result().unwrap(); let error = Command::new("false").result().unwrap_err(); assert!(matches!(error.source, CommandErrorKind::ExitError(1))); assert_eq!(error.command, "false"); let error = Command::new("foobar").result().unwrap_err(); assert!(matches!(error.source, CommandErrorKind::IoError(_))); assert_eq!(error.command, "foobar");