Crates.io | cline |
lib.rs | cline |
version | 0.1.0 |
source | src |
created_at | 2015-11-05 22:39:36.421763 |
updated_at | 2015-12-11 23:58:10.571132 |
description | Lightweight library that allows bash-like completion of registered commands |
homepage | http://chsitter.github.io/CLIne/cline/ |
repository | http://chsitter.github.io/CLIne/cline/ |
max_upload_size | |
id | 3371 |
size | 29,607 |
The cline
crate provides an API that allows users to register CLI commands with an execute and dynamic suggest callback to help implementing command line clients that support auto completion of commands
extern crate cline;
use cline::{Cli, cline_run};
fn main() {
let mut cli = Cli::new();
cli.register(vec!["foo", "bar"], | _ | { println!("running foo bar") });
cli.register(vec!["foo", "baz"], | _ | { println!("running foo baz") });
cline_run(&mut cli);
}
Copyright © 2015 Christoph Sitter
Distributed under the Apache License Version 2.0.