Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search.rs: include platforms in search results #239

Merged
merged 2 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
}
Expand Down
4 changes: 4 additions & 0 deletions src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: ");
Expand Down