interactor

A Rust library for simple (usually command-line) user interaction.
- Reading input from the console with a callback for each byte (e.g. for displaying colorhash256 for a password)
- Selecting an item from a list using an external menu program (usually a fuzzy finder) or a built-in simple menu
Menu program?
A program that accepts a newline-separated list of items on stdin, presents a UI to the user (directly on /dev/tty if it's a CLI; can also be a GUI), and outputs the selected item on stdout.
- fzf (Go)
- peco (Go)
- percol (Python)
- icepick (Rust)
- heatseeker (Rust)
- selecta (Ruby)
- hf (Haskell)
- dmenu (C, X11 GUI)
- rofi (C, X11 GUI)
You should let the users of your application pick their own favorite tool as a config option.
I propose the $MENU environment variable, like $EDITOR, as a place to look for user preference.
Usage
extern crate interactor;
use *;
Contributing
Please feel free to submit pull requests! Bugfixes and simple non-breaking improvements will be accepted without any questions :-)
By participating in this project you agree to follow the Contributor Code of Conduct.
The list of contributors is available on GitHub.
License
This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.