Skip to content

Commit

Permalink
fix clap with default value option #17 (#18)
Browse files Browse the repository at this point in the history
remove `required_unless_present` when with `default_value` configured.
  • Loading branch information
yinheli committed Aug 19, 2022
1 parent 2cfb0e5 commit 858cbb2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion examples/examples/broadcast/broadcast.rs
Expand Up @@ -40,7 +40,6 @@ async fn main() -> Result<()> {
)
.arg(
Arg::new("port")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("8080")
.long("port")
Expand Down
Expand Up @@ -38,7 +38,6 @@ async fn main() -> Result<()> {
)
.arg(
Arg::new("close-after")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("5")
.long("close-after")
Expand Down
2 changes: 0 additions & 2 deletions examples/examples/offer-answer/answer.rs
Expand Up @@ -202,15 +202,13 @@ async fn main() -> Result<()> {
)
.arg(
Arg::new("offer-address")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("localhost:50000")
.long("offer-address")
.help("Address that the Offer HTTP server is hosted on."),
)
.arg(
Arg::new("answer-address")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("0.0.0.0:60000")
.long("answer-address")
Expand Down
2 changes: 0 additions & 2 deletions examples/examples/offer-answer/offer.rs
Expand Up @@ -160,15 +160,13 @@ async fn main() -> Result<()> {
)
.arg(
Arg::new("offer-address")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("0.0.0.0:50000")
.long("offer-address")
.help("Address that the Offer HTTP server is hosted on."),
)
.arg(
Arg::new("answer-address")
.required_unless_present("FULLHELP")
.takes_value(true)
.default_value("localhost:60000")
.long("answer-address")
Expand Down

0 comments on commit 858cbb2

Please sign in to comment.