diff options
Diffstat (limited to 'src/bin/ngit/sub_commands/init.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/init.rs | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 6f3a357..98daee4 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs | |||
| @@ -9,10 +9,12 @@ use std::{ | |||
| 9 | 9 | ||
| 10 | use anyhow::{Context, Result, bail}; | 10 | use anyhow::{Context, Result, bail}; |
| 11 | use console::{Style, Term}; | 11 | use console::{Style, Term}; |
| 12 | use dialoguer::theme::{ColorfulTheme, Theme}; | ||
| 13 | use ngit::{ | 12 | use ngit::{ |
| 14 | UrlWithoutSlash, | 13 | UrlWithoutSlash, |
| 15 | cli_interactor::{PromptChoiceParms, PromptConfirmParms, multi_select_with_custom_value}, | 14 | cli_interactor::{ |
| 15 | PromptChoiceParms, PromptConfirmParms, multi_select_with_custom_value, | ||
| 16 | show_multi_input_prompt_success, | ||
| 17 | }, | ||
| 16 | client::{Params, send_events}, | 18 | client::{Params, send_events}, |
| 17 | git::nostr_url::{CloneUrl, NostrUrlDecoded}, | 19 | git::nostr_url::{CloneUrl, NostrUrlDecoded}, |
| 18 | repo_ref::{ | 20 | repo_ref::{ |
| @@ -904,19 +906,6 @@ fn parse_relay_url(s: &str) -> Result<RelayUrl> { | |||
| 904 | .context(format!("failed to parse relay url: {s}")) | 906 | .context(format!("failed to parse relay url: {s}")) |
| 905 | } | 907 | } |
| 906 | 908 | ||
| 907 | pub fn show_multi_input_prompt_success(label: &str, values: &[String]) { | ||
| 908 | let values_str: Vec<&str> = values.iter().map(std::string::String::as_str).collect(); | ||
| 909 | eprintln!("{}", { | ||
| 910 | let mut s = String::new(); | ||
| 911 | let _ = ColorfulTheme::default().format_multi_select_prompt_selection( | ||
| 912 | &mut s, | ||
| 913 | label, | ||
| 914 | &values_str, | ||
| 915 | ); | ||
| 916 | s | ||
| 917 | }); | ||
| 918 | } | ||
| 919 | |||
| 920 | fn push_main_or_master_branch(git_repo: &Repo) -> Result<()> { | 909 | fn push_main_or_master_branch(git_repo: &Repo) -> Result<()> { |
| 921 | let main_branch_name = { | 910 | let main_branch_name = { |
| 922 | let local_branches = git_repo | 911 | let local_branches = git_repo |