mirror of
https://github.com/nix-community/comma.git
synced 2024-10-05 15:57:55 +03:00
Add --print-package-exit
to only print the package
Instead of printing the package and running the executable
This commit is contained in:
parent
062daa39f1
commit
edf2574596
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user