/// The Read-Eval-Print-Loop is used for quickly interacting with Flipper
/// modules. The command interface for executing module functions is the
/// same as from the command line - it uses the same argument parser.
The Read-Eval-Print-Loop is used for quickly interacting with Flipper
modules. The command interface for executing module functions is the
same as from the command line - it uses the same argument parser.
The Read - Eval - Print - Loop is used for quickly interacting with Flipper modules . The command interface for executing module functions is the same as from the command line - it uses the same argument parser .
pub fn repl() {
    use rustyline::Editor;
    let mut rl = Editor::<()>::new();
    if let Err(_) = rl.load_history("history.txt") {
        println!("No previous history");
    }
    let mut app = make_subcommand().setting(AppSettings::NoBinaryName);
    loop {
        let readline = rl.readline("flipper> ");
        match readline {
            Ok(line) => {
                rl.add_history_entry(&line);
                let args: Vec<&str> = line.split(' ').collect();
                let matches = app.get_matches_from_safe_borrow(args).unwrap();
                println!("Matches object: {:?}", matches);
                if let Err(e) = execute(&matches) {
                    println!("{}", e);
                }
            }
            Err(_) => break,
        }
    }
    rl.save_history("history.txt").unwrap();
}
pub fn repl ( ) { use rustyline :: Editor ; let mut rl = Editor :: < ( ) > :: new ( ) ; if let Err ( _ ) = rl . load_history ( " " ) { println ! ( " " ) ; } let mut app = make_subcommand ( ) . setting ( AppSettings :: NoBinaryName ) ; loop { let readline = rl . readline ( " " ) ; match readline { Ok ( line ) => { rl . add_history_entry ( & line ) ; let args : Vec < & str > = line . split ( ' ' ) . collect ( ) ; let matches = app . get_matches_from_safe_borrow ( args ) . unwrap ( ) ; println ! ( " " matches ) ; if let Err ( e ) = execute ( & matches ) { println ! ( " " e ) ; } } Err ( _ ) => break , } } rl . save_history ( " " ) . unwrap ( ) ; }
The Read-Eval-Print-Loop is used for quickly interacting with Flipper
modules.
The Read - Eval - Print - Loop is used for quickly interacting with Flipper modules .