diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-04-12 17:01:54 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-04-16 17:05:59 +0200 |
commit | 0483283638b22814a5bede9234ce960d125b8dd1 (patch) | |
tree | bd968490a4daacea90e5ee7c37c0f667e09e4840 /imag-link | |
parent | f0c6ac7630e8eb6d3bda9d7328fe9a6675e62b3d (diff) |
Enforce arguments by using ArgGroup
Diffstat (limited to 'imag-link')
-rw-r--r-- | imag-link/src/ui.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/imag-link/src/ui.rs b/imag-link/src/ui.rs index e334c391..95881a58 100644 --- a/imag-link/src/ui.rs +++ b/imag-link/src/ui.rs @@ -1,4 +1,4 @@ -use clap::{Arg, App, SubCommand}; +use clap::{Arg, ArgGroup, App, SubCommand}; pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { app @@ -87,6 +87,10 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .required(false) .help("List external links")) + .group(ArgGroup::with_name("external-link-group") + .args(&["add", "remove", "set", "list"]) + .required(true)) + ) } |