Skip to content

Commit cb64808

Browse files
committed
upgrade clap, fix tests
1 parent c41945f commit cb64808

File tree

4 files changed

+111
-68
lines changed

4 files changed

+111
-68
lines changed

Cargo.lock

+105-59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ anyhow = "1.0.58"
1717
blake3 = "1.3.1"
1818
# Disable clap's suggestions feature, because it sometimes suggests nonsense:
1919
# https://github.com/clap-rs/clap/discussions/3962
20-
clap = { version = "3.2.8", features = ["std", "derive", "color"], default-features = false }
20+
clap = { version = "4", features = ["derive", "std", "color"], default-features = false }
2121
console = { version = "0.15.0", default-features = false }
2222
ctrlc = "3.2.2"
2323
dialoguer = { version = "0.10.1", default-features = false }

src/main.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,17 @@ enum Command {
6565
yes: bool,
6666
/// The names of the commands to expose. If missing, quickenv will determine recommended
6767
/// commands itself and ask for confirmation.
68-
#[clap(value_parser)]
6968
commands: Vec<String>,
7069
},
7170
/// Remove a shim binary from ~/.quickenv/bin/.
7271
Unshim {
73-
#[clap(value_parser)]
7472
/// The names of the commands to remove.
7573
commands: Vec<String>,
7674
},
7775
/// Run a program with .envrc loaded without having to shim it.
7876
Exec {
79-
#[clap(value_parser)]
8077
program_name: OsString,
81-
#[clap(value_parser)]
78+
#[clap(allow_hyphen_values = true, trailing_var_arg = true)]
8279
args: Vec<OsString>,
8380
},
8481
/// Determine which program quickenv's shim would launch under the hood.
@@ -87,7 +84,6 @@ enum Command {
8784
/// happen anyway.
8885
Which {
8986
/// The command name to look up.
90-
#[clap(value_parser)]
9187
program_name: OsString,
9288

9389
/// If quickenv does not have a shim under the given program name, this command errors by

tests/acceptance.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,10 @@ fn test_eating_own_tail3() -> Result<(), Error> {
495495
[ERROR quickenv] failed to run shimmed command
496496
497497
Caused by:
498-
0: failed to find actual binary
499-
1: failed to find hello
500-
2: cannot find binary path
498+
0: failed to run hello
499+
1: failed to find actual binary
500+
2: failed to find hello
501+
3: cannot find binary path
501502
"###);
502503
Ok(())
503504
}

0 commit comments

Comments
 (0)