fn cmdexec(siv: &mut Cursive, state: &mut AppState, cmd: &str) {
    siv.pop_layer();
    for item in state.sel.iter() {
        let mut cmd = Command::new(cmd);
        cmd.args(&[item]);
        if let Err(e) = cmd.spawn() {
            siv.add_layer(
                Dialog::text(format!("{}", e))
                    .title("ERROR")
                    .button("Ok", |siv| {
                        siv.pop_layer();
                    }),
            )
        }
    }
}
/// Open selected files with provided command
Open selected files with provided command
Open selected files with provided command
fn cmdexec(siv: &mut Cursive, state: &mut AppState, cmd: &str) {
    siv.pop_layer();
    for item in state.sel.iter() {
        let mut cmd = Command::new(cmd);
        cmd.args(&[item]);
        if let Err(e) = cmd.spawn() {
            siv.add_layer(
                Dialog::text(format!("{}", e))
                    .title("ERROR")
                    .button("Ok", |siv| {
                        siv.pop_layer();
                    }),
            )
        }
    }
}
fn cmdexec ( siv : & mut Cursive , state : & mut AppState , cmd : & str ) { siv . pop_layer ( ) ; for item in state . sel . iter ( ) { let mut cmd = Command :: new ( cmd ) ; cmd . args ( & [ item ] ) ; if let Err ( e ) = cmd . spawn ( ) { siv . add_layer ( Dialog :: text ( format ! ( " " e ) ) . title ( " " ) . button ( " " , | siv | { siv . pop_layer ( ) ; } ) , ) } } }
Open selected files with provided command
Open selected files with provided command
siv
&mut Cursive
state
&mut AppState
cmd
&str