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)
        }
    }
}
