foil/src/main.rs

39 lines
754 B
Rust
Raw Normal View History

2019-05-25 22:04:54 -04:00
use docopt::Docopt;
use serde::Deserialize;
2019-05-25 22:17:57 -04:00
use log::{debug};
2019-05-25 22:04:54 -04:00
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>,
}
2019-05-25 21:45:00 -04:00
fn main() {
2019-05-25 22:17:57 -04:00
pretty_env_logger::init();
2019-05-25 22:04:54 -04:00
let args: Args = Docopt::new(USAGE)
.and_then(|dopt| dopt.deserialize())
.unwrap_or_else(|e| e.exit());
2019-05-25 22:17:57 -04:00
debug!("{:?}", args);
2019-05-25 22:04:54 -04:00
2019-05-25 21:45:00 -04:00
}