diff options
Diffstat (limited to 'bin/domain/imag-bookmark/src/ui.rs')
-rw-r--r-- | bin/domain/imag-bookmark/src/ui.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/domain/imag-bookmark/src/ui.rs b/bin/domain/imag-bookmark/src/ui.rs index e248a420..d1024764 100644 --- a/bin/domain/imag-bookmark/src/ui.rs +++ b/bin/domain/imag-bookmark/src/ui.rs @@ -79,6 +79,27 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .value_name("ID") .help("IDs of bookmarks to list")) ) + + .subcommand(SubCommand::with_name("find") + .about("Find a bookmark by substring of URL") + .version("0.1") + + .arg(Arg::with_name("substr") + .index(1) + .takes_value(true) + .required(true) + .multiple(false) + .value_name("str") + .help("Substring to search in the URL.")) + + .arg(Arg::with_name("ids") + .index(2) + .takes_value(true) + .required(false) + .multiple(true) + .value_name("IDs") + .help("IDs to search in (if not passed, searches all bookmarks. Can also be provided via STDIN")) + ) } pub struct PathProvider; @@ -102,6 +123,7 @@ impl IdPathProvider for PathProvider { ("add", _) => no_ids_error(), ("remove", Some(subm)) => get_id_paths("ids", subm), ("list", Some(subm)) => get_id_paths("ids", subm), + ("find", Some(subm)) => get_id_paths("ids", subm), (other, _) => Err(format_err!("Not a known command: {}", other)), } } |