mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +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.
|
||||
token: Option<String>,
|
||||
|
||||
/// Set the server as the default.
|
||||
#[clap(long)]
|
||||
set_default: bool,
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue