fui 0.7.1

Add form interface to your CLI program.
Documentation

fui

docs.rs crates.io Build Status MIT licensed

Add form interface to your CLI program.

Note: Use it at own risk!!

Basic example

Cargo.toml

[dependencies]
fui = "0.7"

main.rs

// Example showing imagined CLI app. with two actions

extern crate fui;

use fui::{Fui, Value};
use fui::form::FormView;
use fui::fields::Text;

fn hdlr(v: Value) {
    println!("user input (from hdlr) {:?}", v);
}

fn main() {
    Fui::new()
        .action(
            "ACTION1: description",
            FormView::new().field(Text::new("action1 data").help("help for action1 data")),
            |v| {
                println!("user input (from callback) {:?}", v);
            },
        )
        .action(
            "ACTION2: description",
            FormView::new().field(Text::new("action2 data").help("help for action2 data")),
            hdlr,
        )
        .run();
}

More examples

Here

Screens

TODO:

  • select in autocomplete load values while scrolling
  • support user's history!
    • make fill-error-correct flow pleasent
  • support for piping!
  • create wrapper FileField
  • create wrapper DirField
  • ctrl+enter submits (#151)?
  • checkbox: automatic toggle on char
  • add Field.data & form on_submit returns it?
  • optimalizations
    • feeders use iterators
    • thread
  • tests
  • error handling & unwraps
  • magic stuff:
    • add magic which renders form for clap (or structopt) if args missing
    • add magic which works with current programs like: ls, grep, etc.