You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
738 B
Rust

use docopt::Docopt;
use serde::Deserialize;
static USAGE: &'static str = "
foil
Usage:
foil set [--db=<db>]
foil get [--db=<db>]
foil list [--db=<db>]
foil generate <spec>
foil (-h | --help)
Options:
--db=<db> The path to the sqlite database [default: db.sqlite3].
-h --help Show this screen.
--version Show version.
";
#[derive(Debug, Deserialize)]
struct Args {
cmd_set: bool,
cmd_get: bool,
cmd_list: bool,
cmd_generate: bool,
flag_db: Option<String>,
arg_spec: Option<String>,
}
fn main() {
println!("Hello, world!");
let args: Args = Docopt::new(USAGE)
.and_then(|dopt| dopt.deserialize())
.unwrap_or_else(|e| e.exit());
println!("{:?}", args);
}