cindy-cli 0.1.1

Managing infrastructure at breakneck speed.
pub trait ConditionalSudoCommand {
    fn conditional_sudo_command<'a>(
        &'a self,
        sudo: bool,
        command: &str,
    ) -> openssh::OwningCommand<&'a openssh::Session>;
}
impl ConditionalSudoCommand for openssh::Session {
    fn conditional_sudo_command<'a>(
        &'a self,
        sudo: bool,
        command: &str,
    ) -> openssh::OwningCommand<&'a openssh::Session> {
        if sudo {
            let mut c = self.command("sudo");
            c.arg(command);
            c
        } else {
            self.command(command)
        }
    }
}