upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-16 22:16:28 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-16 22:22:20 +0000
commitcff8bfadd3b28887e6f0625f2672e0ffcb039f67 (patch)
tree7c716e2651cb5d7b323c6c1ffcc24d8bf2b9873b /src/bin/ngit
parentedb5465abf286dd9bc4533f4cf95e34765ee0bca (diff)
Show active filter in ngit list output
Users may not be aware that ngit list defaults to filtering by open,draft status. Display the active filter at the top of the output to make this clear.
Diffstat (limited to 'src/bin/ngit')
-rw-r--r--src/bin/ngit/sub_commands/list.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs
index 0750ce0..76220d9 100644
--- a/src/bin/ngit/sub_commands/list.rs
+++ b/src/bin/ngit/sub_commands/list.rs
@@ -205,7 +205,7 @@ pub async fn launch(status: String, json: bool, id: Option<String>) -> Result<()
205 if json { 205 if json {
206 output_json(&filtered_proposals, &repo_ref)?; 206 output_json(&filtered_proposals, &repo_ref)?;
207 } else { 207 } else {
208 output_table(&filtered_proposals, &repo_ref); 208 output_table(&filtered_proposals, &repo_ref, &status);
209 } 209 }
210 210
211 Ok(()) 211 Ok(())
@@ -221,9 +221,9 @@ fn status_kind_to_str(kind: Kind) -> &'static str {
221 } 221 }
222} 222}
223 223
224fn output_table(proposals: &[(&nostr::Event, Kind)], _repo_ref: &RepoRef) { 224fn output_table(proposals: &[(&nostr::Event, Kind)], _repo_ref: &RepoRef, status_filter: &str) {
225 if proposals.is_empty() { 225 if proposals.is_empty() {
226 println!("No proposals found matching the filter."); 226 println!("No proposals found matching status: {status_filter}");
227 return; 227 return;
228 } 228 }
229 229
@@ -242,6 +242,7 @@ fn output_table(proposals: &[(&nostr::Event, Kind)], _repo_ref: &RepoRef) {
242 } 242 }
243 243
244 println!(); 244 println!();
245 println!("--status {status_filter}");
245 println!("To view: ngit list <id>"); 246 println!("To view: ngit list <id>");
246 println!("To checkout: ngit checkout <id>"); 247 println!("To checkout: ngit checkout <id>");
247 println!("To apply: ngit apply <id>"); 248 println!("To apply: ngit apply <id>");