diff --git a/src/interface.rs b/src/interface.rs index 4df8020..f908243 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -180,6 +180,10 @@ pub struct SearchArgs { /// Name of the channel to query (e.g nixos-23.11, nixos-unstable, etc) pub channel: String, + #[arg(long, short = 'P')] + /// Show supported platforms for each package + pub platforms: bool, + /// Name of the package to search pub query: Vec, } diff --git a/src/search.rs b/src/search.rs index f588189..b0b90f8 100644 --- a/src/search.rs +++ b/src/search.rs @@ -177,6 +177,10 @@ impl SearchArgs { } } + if self.platforms && !elem.package_platforms.is_empty() { + println!(" Platforms: {}", elem.package_platforms.join(", ")); + } + if let Some(position) = &elem.package_position { let position = position.split(':').next().unwrap(); print!(" Defined at: ");