Skip to content

Commit

Permalink
fix arguement conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas committed Nov 5, 2022
1 parent f13776e commit 5e333c7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ async fn main() -> Result<(), GertError> {
.value_name("URL")
.help("URL of a single post to download")
.takes_value(true)
.required_unless("subreddit"),
.required_unless("subreddit")
.conflicts_with_all(&["subreddit", "period", "feed", "limit", "match"]),
)
.arg(
Arg::with_name("environment")
Expand All @@ -55,7 +56,6 @@ async fn main() -> Result<(), GertError> {
.value_name("MATCH")
.help("Pass a regex expresion to filter the title of the post")
.takes_value(true)
.conflicts_with("url"),
)
.arg(
Arg::with_name("output_directory")
Expand Down Expand Up @@ -94,7 +94,6 @@ async fn main() -> Result<(), GertError> {
.help("Limit the number of posts to download")
.takes_value(true)
.default_value("25")
.conflicts_with("url"),
)
.arg(
Arg::with_name("subreddits")
Expand All @@ -117,7 +116,6 @@ async fn main() -> Result<(), GertError> {
.takes_value(true)
.possible_values(&["now", "hour", "day", "week", "month", "year", "all"])
.default_value("day")
.conflicts_with("url"),
)
.arg(
Arg::with_name("feed")
Expand All @@ -128,7 +126,6 @@ async fn main() -> Result<(), GertError> {
.takes_value(true)
.possible_values(&["hot", "new", "top", "rising"])
.default_value("hot")
.conflicts_with("url"),
)
.get_matches();

Expand Down

0 comments on commit 5e333c7

Please sign in to comment.