diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-06-14 19:02:29 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-06-14 19:02:29 -0400 |
| commit | 94d3fd454b8f70a430fc787357fdaccd7397e347 (patch) | |
| tree | f0f70bd1fb7598702df860a02e4cefc5e0624397 | |
| parent | 95742615ef31e7751663b0192a882fb7e5a9d718 (diff) | |
Add a rudimentary help interface to the CLI.
| -rw-r--r-- | src/birka-cli.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/birka-cli.rs b/src/birka-cli.rs index 1e05712..484d2ed 100644 --- a/src/birka-cli.rs +++ b/src/birka-cli.rs @@ -29,8 +29,12 @@ use std::path::Path; fn main() { let args: Vec<String> = env::args().collect(); - if args.len() < 2 { - eprintln!("usage: {} ACTION [ARGS ...]", args[0]); + if args.len() < 2 || args.iter().any(|arg| arg == "-h" || arg == "--help") { + println!("usage: {} ACTION [ARGS ...]", args[0]); + println!("\tACTION: add [PATH] [TAGS ...]: index an image, optionally tagged."); + println!("\tACTION: add_tags [PATH] [TAGS ...]: add tags to an indexed image."); + println!("\tACTION: remove_tags [PATH] [TAGS ...]: remove tags from an indexed image."); + println!("\tACTION: query [QUERY_STRING]: list images in the database."); std::process::exit(1); } |