fui
Add CLI & form interface to your program.
Basic example
cargo.toml
[]
= "1.0"
Using with clap
(experimental)
extern crate clap;
extern crate fui;
use ;
use Fui;
use env;
// regular clap code
let app = new.arg;
// extra fui code
let mut _arg_vec: = args.collect;
if _arg_vec.len <= 1
// regular clap code
let matches = app.get_matches_from;
Using without clap
// Example showing imagined CLI app. with two actions
extern crate clap;
extern crate fui;
use ;
use FormView;
use Text;
This will make the program automatically working in 2 modes:
-
Ready for parsing CLI arguments, like here:
& ) )
-
Ready for getting user input from easy and discoverable TUI interface, like image below:
More examples
Screens
Clap support
Implemented features
- switch arguments
- positional arguments
- option arguments
- global arguments
- subcommands (single level)
To be implemented
- conflicts_with
- requires
- validators
- min/max/exact number of values for
- positional args
- options args
- groups
- conditional defaults
- custom delimeter
TODO
- find a solution for long help messages
- ctrl+enter submits (#151)
- handle unwraps
Ideas
.validator(OneOf || Regex::new("v\d+\.\d+\.\d+")).unwrap()
?- support user's history?
- checkboxes: automatic toggle on char(+alt)?
- replace
views::Autocomplete
&views::Multiselect
with a new implementation ofAutocomplete