use std::borrow::Cow;
use std::fmt::Display;
#[cfg(doc)]
use std::process::Command;
use dyn_clone::DynClone;
#[cfg(doc)]
use crate::Utf8ProgramAndArgs;
pub trait CommandDisplay: Display + DynClone {
fn program(&self) -> Cow<'_, str>;
fn program_quoted(&self) -> Cow<'_, str> {
Cow::Owned(shell_words::quote(&self.program()).into_owned())
}
fn args(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>;
}
impl Clone for Box<dyn CommandDisplay + Send + Sync> {
fn clone(&self) -> Self {
dyn_clone::clone_box(&**self)
}
}