diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-10-27 22:16:46 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-10-27 22:16:46 -0400 |
commit | 5d0e308c1c57bea30d2ad9008b6dbc7936d58645 (patch) | |
tree | 3c3798d5fb826aeaca62e11d9e56e1e3b610ca2b /src/bin/rbw/main.rs | |
parent | 7b95f7b9d84c44ca273c1a1ce7ab62925d4a5def (diff) | |
download | rbw-5d0e308c1c57bea30d2ad9008b6dbc7936d58645.tar.gz rbw-5d0e308c1c57bea30d2ad9008b6dbc7936d58645.zip |
add a separate "register" command to log in with api keys
Diffstat (limited to 'src/bin/rbw/main.rs')
-rw-r--r-- | src/bin/rbw/main.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/bin/rbw/main.rs b/src/bin/rbw/main.rs index 2612398..0f2d13e 100644 --- a/src/bin/rbw/main.rs +++ b/src/bin/rbw/main.rs @@ -17,14 +17,11 @@ enum Opt { config: Config, }, + #[structopt(about = "Register this device with the Bitwarden server")] + Register, + #[structopt(about = "Log in to the Bitwarden server")] - Login { - #[structopt( - long, - help = "Log in to the Bitwarden server using your user API key (see https://bitwarden.com/help/article/personal-api-key/)" - )] - apikey: bool, - }, + Login, #[structopt(about = "Unlock the local Bitwarden database")] Unlock, @@ -220,7 +217,8 @@ impl Opt { Self::Config { config } => { format!("config {}", config.subcommand_name()) } - Self::Login { .. } => "login".to_string(), + Self::Register => "register".to_string(), + Self::Login => "login".to_string(), Self::Unlock => "unlock".to_string(), Self::Unlocked => "unlocked".to_string(), Self::Sync => "sync".to_string(), @@ -290,7 +288,8 @@ fn main(opt: Opt) { Config::Set { key, value } => commands::config_set(key, value), Config::Unset { key } => commands::config_unset(key), }, - Opt::Login { apikey } => commands::login(*apikey), + Opt::Register => commands::register(), + Opt::Login => commands::login(), Opt::Unlock => commands::unlock(), Opt::Unlocked => commands::unlocked(), Opt::Sync => commands::sync(), |