summaryrefslogtreecommitdiffstats
path: root/bin/domain/imag-bookmark/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/domain/imag-bookmark/src/ui.rs')
-rw-r--r--bin/domain/imag-bookmark/src/ui.rs37
1 files changed, 25 insertions, 12 deletions
diff --git a/bin/domain/imag-bookmark/src/ui.rs b/bin/domain/imag-bookmark/src/ui.rs
index d1024764..a4016a49 100644
--- a/bin/domain/imag-bookmark/src/ui.rs
+++ b/bin/domain/imag-bookmark/src/ui.rs
@@ -54,18 +54,30 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.help("Remove these urls, specified as ID"))
)
- // .subcommand(SubCommand::with_name("open")
- // .about("Open bookmarks (via xdg-open)")
- // .version("0.1")
- // .arg(Arg::with_name("collection")
- // .long("collection")
- // .short("c")
- // .takes_value(true)
- // .required(true)
- // .multiple(false)
- // .value_name("COLLECTION")
- // .help("Select from this collection"))
- // )
+ .subcommand(SubCommand::with_name("open")
+ .about("Open bookmarks")
+ .version("0.1")
+ .arg(Arg::with_name("ids")
+ .index(1)
+ .takes_value(true)
+ .required(false)
+ .multiple(true)
+ .value_name("ID")
+ .help("open these urls, specified as ID"))
+ .arg(Arg::with_name("opencmd")
+ .long("with")
+ .takes_value(true)
+ .required(false)
+ .multiple(false)
+ .value_name("spec")
+ .help("Open by executing this command, '{{url}}' will be replaced with the URL of the bookmark. Default is the setting bookmark.open in the configuration file."))
+ .arg(Arg::with_name("openparallel")
+ .long("parallel")
+ .takes_value(false)
+ .required(false)
+ .multiple(false)
+ .help("Open all links in parallel, don't open sequencially if opening commands blocks."))
+ )
.subcommand(SubCommand::with_name("list")
.about("List bookmarks, if used in pipe, ignores everything that is not a bookmark")
@@ -121,6 +133,7 @@ impl IdPathProvider for PathProvider {
match matches.subcommand() {
("add", _) => no_ids_error(),
+ ("open", Some(subm)) => get_id_paths("ids", subm),
("remove", Some(subm)) => get_id_paths("ids", subm),
("list", Some(subm)) => get_id_paths("ids", subm),
("find", Some(subm)) => get_id_paths("ids", subm),