deploy-rs icon indicating copy to clipboard operation
deploy-rs copied to clipboard

a6b0cb2c5e1c1efea2d48fdf7bb5b36b6675e40e broke `--targets`

Open cmm opened this issue 6 months ago • 3 comments

Single argument to --targets is still fine, but multiple targets are not. Now when you say deploy --targets .#{host-a,host-b}.system you get:

error: the argument '--targets <TARGETS>' cannot be used with '[TARGET]'

Usage: deploy --targets <TARGETS> [TARGET] <EXTRA_BUILD_ARGS>...

The commit in question "just" updates deps, perhaps the Clap major-version bump is the problem?

cmm avatar Jun 05 '25 20:06 cmm

Hey, this seems like an upstream problem, see

weriomat avatar Jun 06 '25 07:06 weriomat

Hey, a fix might be in cli.rs to add num_args = 1.. (https://docs.rs/clap/latest/clap/struct.Arg.html#method.num_args I think)

 /// A list of flakes to deploy alternatively
    #[arg(long, group = "deploy", num_args = 1..)]
    targets: Option<Vec<String>>,

It then works (https://github.com/VolodiaPG/deploy-rs)

VolodiaPG avatar Jun 06 '25 07:06 VolodiaPG

it also breaks passing build args:

nix run "github:serokell/deploy-rs?rev=a6b0cb2" -- --targets .#wsl -- -Lv

error: the argument '--targets <TARGETS>' cannot be used with '[TARGET]'

Usage: deploy --skip-checks --keep-result --targets <TARGETS> [TARGET] [EXTRA_BUILD_ARGS]...

the prior commit works fine with:

nix run "github:serokell/deploy-rs?rev=5829cec" -- --targets .#wsl -- -Lv

Also PR #327 does not fix build args:

nix run "github:VolodiaPG/deploy-rs?rev=2edaf49" -- --targets .#wsl.system -- -Lv

error: the argument '--targets <TARGETS>...' cannot be used with '[TARGET]'

Usage: deploy --skip-checks --keep-result --targets <TARGETS>... [TARGET] [EXTRA_BUILD_ARGS]...

sedlund avatar Jun 28 '25 17:06 sedlund