mirror of
https://codeberg.org/Cyborus/forgejo-cli.git
synced 2024-09-20 08:05:04 +02:00
Merge pull request 'don't print url scheme in fj user
' (#46) from user-no-scheme into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/46
This commit is contained in:
commit
4061f79e75
1 changed files with 9 additions and 2 deletions
11
src/main.rs
11
src/main.rs
|
@ -1,5 +1,5 @@
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use eyre::{eyre, Context};
|
use eyre::{eyre, Context, OptionExt};
|
||||||
use tokio::io::AsyncWriteExt;
|
use tokio::io::AsyncWriteExt;
|
||||||
|
|
||||||
mod keys;
|
mod keys;
|
||||||
|
@ -48,7 +48,14 @@ async fn main() -> eyre::Result<()> {
|
||||||
.host_url()
|
.host_url()
|
||||||
.clone();
|
.clone();
|
||||||
let name = keys.get_login(&url)?.username();
|
let name = keys.get_login(&url)?.username();
|
||||||
eprintln!("currently signed in to {name}@{url}");
|
let host = url
|
||||||
|
.host_str()
|
||||||
|
.ok_or_eyre("instance url does not have host")?;
|
||||||
|
if url.path() == "/" || url.path().is_empty() {
|
||||||
|
println!("currently signed in to {name}@{host}");
|
||||||
|
} else {
|
||||||
|
println!("currently signed in to {name}@{host}{}", url.path());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Command::Auth(subcommand) => subcommand.run(&mut keys).await?,
|
Command::Auth(subcommand) => subcommand.run(&mut keys).await?,
|
||||||
Command::Release(subcommand) => subcommand.run(&mut keys, host_name).await?,
|
Command::Release(subcommand) => subcommand.run(&mut keys, host_name).await?,
|
||||||
|
|
Loading…
Reference in a new issue