Skip to content

Commit

Permalink
Merge #83
Browse files Browse the repository at this point in the history
83: Naming consistency for arguments of subcommands. r=Hoverbear a=amanjeev

Make `which` subcommand use the same term as `run`.

Co-authored-by: Amanjeev Sethi <amanjeev.sethi@ferrous-systems.com>
Co-authored-by: Ana Hobden <operator@hoverbear.org>
  • Loading branch information
3 people authored Feb 4, 2025
2 parents 47d9886 + 8f75221 commit b0e1229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/criticalup-cli/src/cli/subcommand/which.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tracing::Span;
#[derive(Debug, Parser)]
pub(crate) struct Which {
/// Name of the binary to find the absolute path of
binary: String,
command: String,
/// Path to the manifest `criticalup.toml`
#[arg(long)]
project: Option<PathBuf>,
Expand All @@ -41,7 +41,7 @@ impl CommandExecute for Which {
let bin_path = PathBuf::from("bin");

let mut tool_executable = PathBuf::new();
tool_executable.set_file_name(&self.binary);
tool_executable.set_file_name(&self.command);

let tools_bin_path = abs_installation_dir_path.join(bin_path.join(&tool_executable));

Expand All @@ -56,11 +56,11 @@ impl CommandExecute for Which {
if tools_bin_path_with_exe.exists() {
println!("{}\n", tools_bin_path_with_exe.display());
} else {
return Err(BinaryNotInstalled(self.binary));
return Err(BinaryNotInstalled(self.command));
}
}
#[cfg(not(windows))]
return Err(BinaryNotInstalled(self.binary));
return Err(BinaryNotInstalled(self.command));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ stderr
Display which binary will be run for a given command

Usage:
criticalup-test which [OPTIONS] <BINARY>
criticalup-test which [OPTIONS] <COMMAND>

Arguments:
<BINARY> Name of the binary to find the absolute path of
<COMMAND> Name of the binary to find the absolute path of

Options:
--project <PROJECT> Path to the manifest `criticalup.toml`
Expand Down

0 comments on commit b0e1229

Please sign in to comment.