Skip to content

Commit

Permalink
Fix clap argument handling
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Aug 21, 2021
1 parent fca789d commit 32ac67f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ fn parse_args() -> Args {
} else {
vec!["clear-cache", "list-templates"]
})
.number_of_values(1)
.conflicts_with_all(if cfg!(windows) {
&["list-templates", "install-file-association", "uninstall-file-association"]
} else {
Expand All @@ -124,7 +123,6 @@ fn parse_args() -> Args {
.about("Arguments for the script to execute.")
.multiple_values(true)
.min_values(0)
.last(true)
)
.arg(Arg::new("expr")
.about("Execute <script> as a literal expression and display the result.")
Expand Down Expand Up @@ -166,23 +164,23 @@ fn parse_args() -> Args {
.long("dep")
.short('d')
.takes_value(true)
.multiple_values(true)
.multiple_occurrences(true)
.number_of_values(1)
)
.arg(Arg::new("dep_extern")
.about("Like `dep`, except that it *also* adds a `#[macro_use] extern crate name;` item for expression and loop scripts. Note that this only works if the name of the dependency and the name of the library it generates are exactly the same.")
.long("dep-extern")
.short('D')
.takes_value(true)
.multiple_values(true)
.multiple_occurrences(true)
.requires("expr_or_loop")
)
.arg(Arg::new("extern")
.about("Adds an `#[macro_use] extern crate name;` item for expressions and loop scripts.")
.long("extern")
.short('x')
.takes_value(true)
.multiple_values(true)
.multiple_occurrences(true)
.requires("expr_or_loop")
)
.arg(Arg::new("features")
Expand All @@ -195,7 +193,7 @@ fn parse_args() -> Args {
.long("unstable-feature")
.short('u')
.takes_value(true)
.multiple_values(true)
.multiple_occurrences(true)
.requires("expr_or_loop")
)

Expand Down

0 comments on commit 32ac67f

Please sign in to comment.