Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Nov 14, 2023
1 parent 25faee6 commit 89b4185
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wait-service"
version = "0.3.0"
version = "0.3.1"
authors = ["Magic Len <len@magiclen.org>"]
edition = "2021"
rust-version = "1.70"
Expand Down
10 changes: 7 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,26 @@ pub struct CLIArgs {

#[arg(long)]
#[arg(num_args = 1..)]
#[cfg_attr(unix, cfg_attr(feature = "json", arg(required_unless_present_any = ["uds", "json"], required_unless_present = "uds")), cfg_attr(feature = "json", arg(required_unless_present = "json")))]
#[cfg_attr(all(unix, feature = "json"), arg(required_unless_present_any = ["uds", "json"]))]
#[cfg_attr(all(unix, not(feature = "json")), arg(required_unless_present = "uds"))]
#[cfg_attr(all(not(unix), feature = "json"), arg(required_unless_present = "json"))]
#[arg(help = "Test and wait on the availability of TCP services")]
pub tcp: Vec<String>,

#[cfg(unix)]
#[arg(long, visible_alias = "unix")]
#[arg(num_args = 1..)]
#[cfg_attr(feature = "json", arg(required_unless_present_any = ["tcp", "json"]), arg(required_unless_present = "tcp"))]
#[cfg_attr(feature = "json", arg(required_unless_present_any = ["tcp", "json"]))]
#[cfg_attr(not(feature = "json"), arg(required_unless_present = "tcp"))]
#[arg(value_hint = clap::ValueHint::FilePath)]
#[arg(help = "Test and wait on the availability of UDS services")]
pub uds: Vec<PathBuf>,

#[cfg(feature = "json")]
#[arg(long)]
#[arg(num_args = 1..)]
#[cfg_attr(unix, arg(required_unless_present_any = ["tcp", "uds"]), arg(required_unless_present = "tcp"))]
#[cfg_attr(unix, arg(required_unless_present_any = ["tcp", "uds"]))]
#[cfg_attr(not(unix), arg(required_unless_present = "tcp"))]
#[arg(value_hint = clap::ValueHint::FilePath)]
#[arg(help = "Test and wait on the availability of TCP or UDS services")]
pub json: Vec<PathBuf>,
Expand Down

0 comments on commit 89b4185

Please sign in to comment.