promptly
A simple, opinionated prompting library
Basic features include:
- Re-prompt until valid
- Prompts for several types, and extensible
- Sane handling of escapes via rustyline
- Path completion when prompting for paths
- Dead simple to use. Perhaps too simple.
Usage
use Promptable;
// Prompt until a non-empty string is provided
let name = Stringprompt;
// Prompt for other `FromStr` types
let age = u32prompt;
// Prompt for optional paths with path completion. Returns `None` if empty input.
let photo = prompt_opt;
// Prompt Y/n with a default value when input is empty
let fallback = boolprompt_default;
There are a few other bits exposed that might evolve a bit, but the above really captures the gist of it.