Add --print-package-exit to only print the package

Instead of printing the package and running the executable
This commit is contained in:
Artturin 2024-06-17 17:51:25 +03:00
parent 062daa39f1
commit edf2574596

View File

@ -127,12 +127,15 @@ fn main() -> ExitCode {
}
.contains("nixpkgs=");
if args.print_package {
if args.print_package || args.print_package_exit {
println!(
"Package that contains executable /bin/{}: {}",
command,
&choice.rsplit('.').last().unwrap()
);
if args.print_package_exit {
return ExitCode::SUCCESS
}
};
if args.install {
@ -191,6 +194,10 @@ struct Opt {
#[clap(short = 'p', long = "print-package")]
print_package: bool,
/// Print the package containing the executable
#[clap(long = "print-package-exit")]
print_package_exit: bool,
/// Print the absolute path to the executable in the nix store
#[clap(short = 'x', long = "print-path")]
print_path: bool,