mirror of
https://github.com/zhaofengli/attic.git
synced 2025-03-05 08:17:05 +00:00
client/login: Add --set-default
This commit is contained in:
parent
425a757ad9
commit
d6c4d883f8
1 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,10 @@ pub struct Login {
|
||||||
|
|
||||||
/// Access token.
|
/// Access token.
|
||||||
token: Option<String>,
|
token: Option<String>,
|
||||||
|
|
||||||
|
/// Set the server as the default.
|
||||||
|
#[clap(long)]
|
||||||
|
set_default: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run(opts: Opts) -> Result<()> {
|
pub async fn run(opts: Opts) -> Result<()> {
|
||||||
|
@ -43,7 +47,7 @@ pub async fn run(opts: Opts) -> Result<()> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if config_m.servers.len() == 1 {
|
if sub.set_default || config_m.servers.len() == 1 {
|
||||||
config_m.default_server = Some(sub.name.to_owned());
|
config_m.default_server = Some(sub.name.to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue