Skip to content

Commit

Permalink
upgrade clap, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed May 18, 2024
1 parent c41945f commit cb64808
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 68 deletions.
164 changes: 105 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ anyhow = "1.0.58"
blake3 = "1.3.1"
# Disable clap's suggestions feature, because it sometimes suggests nonsense:
# https://github.com/clap-rs/clap/discussions/3962
clap = { version = "3.2.8", features = ["std", "derive", "color"], default-features = false }
clap = { version = "4", features = ["derive", "std", "color"], default-features = false }
console = { version = "0.15.0", default-features = false }
ctrlc = "3.2.2"
dialoguer = { version = "0.10.1", default-features = false }
Expand Down
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,17 @@ enum Command {
yes: bool,
/// The names of the commands to expose. If missing, quickenv will determine recommended
/// commands itself and ask for confirmation.
#[clap(value_parser)]
commands: Vec<String>,
},
/// Remove a shim binary from ~/.quickenv/bin/.
Unshim {
#[clap(value_parser)]
/// The names of the commands to remove.
commands: Vec<String>,
},
/// Run a program with .envrc loaded without having to shim it.
Exec {
#[clap(value_parser)]
program_name: OsString,
#[clap(value_parser)]
#[clap(allow_hyphen_values = true, trailing_var_arg = true)]
args: Vec<OsString>,
},
/// Determine which program quickenv's shim would launch under the hood.
Expand All @@ -87,7 +84,6 @@ enum Command {
/// happen anyway.
Which {
/// The command name to look up.
#[clap(value_parser)]
program_name: OsString,

/// If quickenv does not have a shim under the given program name, this command errors by
Expand Down
7 changes: 4 additions & 3 deletions tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ fn test_eating_own_tail3() -> Result<(), Error> {
[ERROR quickenv] failed to run shimmed command
Caused by:
0: failed to find actual binary
1: failed to find hello
2: cannot find binary path
0: failed to run hello
1: failed to find actual binary
2: failed to find hello
3: cannot find binary path
"###);
Ok(())
}
Expand Down

0 comments on commit cb64808

Please sign in to comment.