diff options
Diffstat (limited to 'src/bin/ngit/sub_commands/list.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/list.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index 6d78a1f..b008cf0 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | use std::{ | 1 | use std::{ |
| 2 | collections::HashSet, io::Write, ops::Add, | 2 | collections::HashSet, |
| 3 | io::Write, | ||
| 4 | ops::Add, | ||
| 3 | process::{Command, Stdio}, | 5 | process::{Command, Stdio}, |
| 4 | }; | 6 | }; |
| 5 | 7 | ||
| @@ -16,9 +18,11 @@ use ngit::{ | |||
| 16 | }, | 18 | }, |
| 17 | repo_ref::{RepoRef, is_grasp_server_in_list}, | 19 | repo_ref::{RepoRef, is_grasp_server_in_list}, |
| 18 | }; | 20 | }; |
| 19 | use nostr::filter::{Alphabet, SingleLetterTag}; | 21 | use nostr::{ |
| 20 | use nostr::nips::nip19::Nip19; | 22 | FromBech32, ToBech32, |
| 21 | use nostr::{FromBech32, ToBech32}; | 23 | filter::{Alphabet, SingleLetterTag}, |
| 24 | nips::nip19::Nip19, | ||
| 25 | }; | ||
| 22 | use nostr_sdk::Kind; | 26 | use nostr_sdk::Kind; |
| 23 | 27 | ||
| 24 | use crate::{ | 28 | use crate::{ |
| @@ -242,8 +246,7 @@ fn show_proposal_details( | |||
| 242 | json: bool, | 246 | json: bool, |
| 243 | ) -> Result<()> { | 247 | ) -> Result<()> { |
| 244 | let target_id = if event_id_or_nevent.starts_with("nevent") { | 248 | let target_id = if event_id_or_nevent.starts_with("nevent") { |
| 245 | let nip19 = Nip19::from_bech32(event_id_or_nevent) | 249 | let nip19 = Nip19::from_bech32(event_id_or_nevent).context("failed to parse nevent")?; |
| 246 | .context("failed to parse nevent")?; | ||
| 247 | match nip19 { | 250 | match nip19 { |
| 248 | Nip19::EventId(id) => id, | 251 | Nip19::EventId(id) => id, |
| 249 | Nip19::Event(event) => event.event_id, | 252 | Nip19::Event(event) => event.event_id, |
| @@ -294,7 +297,10 @@ fn show_proposal_details( | |||
| 294 | } | 297 | } |
| 295 | 298 | ||
| 296 | println!(); | 299 | println!(); |
| 297 | println!("To checkout: ngit checkout {}", &proposal.id.to_string()[..7]); | 300 | println!( |
| 301 | "To checkout: ngit checkout {}", | ||
| 302 | &proposal.id.to_string()[..7] | ||
| 303 | ); | ||
| 298 | println!("To apply: ngit apply {}", &proposal.id.to_string()[..7]); | 304 | println!("To apply: ngit apply {}", &proposal.id.to_string()[..7]); |
| 299 | 305 | ||
| 300 | Ok(()) | 306 | Ok(()) |