diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-27 08:55:31 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-27 08:55:31 +0000 |
| commit | c002cef1e5d19946244086531f1178446fed8545 (patch) | |
| tree | 39067fb72431b464a31d23adb3adee85443c04d4 /src/bin/ngit/sub_commands/login.rs | |
| parent | 242601c972b7186ad380d301b7c12ce9d19aa959 (diff) | |
feat(logout): add logout command
rather than using `ngit login` which is less intuative
Diffstat (limited to 'src/bin/ngit/sub_commands/login.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/login.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/ngit/sub_commands/login.rs b/src/bin/ngit/sub_commands/login.rs index afde145..7670bc3 100644 --- a/src/bin/ngit/sub_commands/login.rs +++ b/src/bin/ngit/sub_commands/login.rs | |||
| @@ -144,7 +144,7 @@ async fn logout(git_repo: Option<&Repo>, local_only: bool) -> Result<(bool, bool | |||
| 144 | Ok((true, local_only)) | 144 | Ok((true, local_only)) |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | fn get_global_login_config_items_set() -> Vec<&'static str> { | 147 | pub fn get_global_login_config_items_set() -> Vec<&'static str> { |
| 148 | [ | 148 | [ |
| 149 | "nostr.nsec", | 149 | "nostr.nsec", |
| 150 | "nostr.npub", | 150 | "nostr.npub", |
| @@ -157,7 +157,7 @@ fn get_global_login_config_items_set() -> Vec<&'static str> { | |||
| 157 | .collect::<Vec<&str>>() | 157 | .collect::<Vec<&str>>() |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | fn format_items_as_list(items: &[&str]) -> String { | 160 | pub fn format_items_as_list(items: &[&str]) -> String { |
| 161 | match items.len() { | 161 | match items.len() { |
| 162 | 0 => String::new(), | 162 | 0 => String::new(), |
| 163 | 1 => items[0].to_string(), | 163 | 1 => items[0].to_string(), |