Proceed

Current Release: v0.1.0

License builds.sr.ht status Latest version Documentation

A simple set of common utility functions for checking with the user of your command line application.

These are wrappers around a flexible user-input checker, so you can customize as needed.

Out-of-Scope:

Examples:

Just check yes or no, with a default of either YES or NO. ```rust use proceed::{proceed, NO};

fn main() { print!("Are you sure? [y/N]"); if !proceed(NO) { return; } // Do things now that we got confirmation. } ```

Continue on any user input (but 'q' for quit). Needs term feature enabled, otherwise user will need to press "Enter" afterwards. ```rust use proceed::anyorquit;

fn main() { println!("We are about to do something expensive."); print!("Press any key to continue, or 'q' to quit."); if !anyorquit_with('q') { println!("Quitting."); return; } // Do expensive operation. } ```