diff --git a/libcitadel/src/util.rs b/libcitadel/src/util.rs index 448ed2e..8623337 100644 --- a/libcitadel/src/util.rs +++ b/libcitadel/src/util.rs @@ -27,6 +27,18 @@ pub fn exec_cmdline>(cmd_path: &str, args: S) -> Result<()> { check_cmd_status(cmd_path, &status) } +pub fn exec_cmdline_quiet>(cmd_path: &str, args: S) -> Result<()> { + ensure_command_exists(cmd_path)?; + let args: Vec<&str> = args.as_ref().split_whitespace().collect::>(); + let status = Command::new(cmd_path) + .args(args) + .stderr(Stdio::null()) + .stdout(Stdio::null()) + .status()?; + + check_cmd_status(cmd_path, &status) +} + pub fn exec_cmdline_with_output>(cmd_path: &str, args: S) -> Result { ensure_command_exists(cmd_path)?; let args: Vec<&str> = args.as_ref().split_whitespace().collect::>();