From 94d3fd454b8f70a430fc787357fdaccd7397e347 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Sun, 14 Jun 2020 19:02:29 -0400 Subject: Add a rudimentary help interface to the CLI. --- src/birka-cli.rs | 8 ++++++-- 1 file 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 = 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); } -- cgit v1.3