Enforce arguments by using ArgGroup
This commit is contained in:
parent
f0c6ac7630
commit
0483283638
1 changed files with 5 additions and 1 deletions
|
@ -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> {
|
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
|
||||||
app
|
app
|
||||||
|
@ -87,6 +87,10 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
|
||||||
.required(false)
|
.required(false)
|
||||||
.help("List external links"))
|
.help("List external links"))
|
||||||
|
|
||||||
|
.group(ArgGroup::with_name("external-link-group")
|
||||||
|
.args(&["add", "remove", "set", "list"])
|
||||||
|
.required(true))
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue