aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/rbw/main.rs')
-rw-r--r--src/bin/rbw/main.rs33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/bin/rbw/main.rs b/src/bin/rbw/main.rs
index 6c6c33e..85631c5 100644
--- a/src/bin/rbw/main.rs
+++ b/src/bin/rbw/main.rs
@@ -17,6 +17,17 @@ enum Opt {
config: Config,
},
+ #[structopt(
+ about = "Register this device with the Bitwarden server",
+ long_about = "Register this device with the Bitwarden server\n\n\
+ The official Bitwarden server includes bot detection to prevent \
+ brute force attacks. In order to avoid being detected as bot \
+ traffic, you will need to use this command to log in with your \
+ personal API key (instead of your password) first before regular \
+ logins will work."
+ )]
+ Register,
+
#[structopt(about = "Log in to the Bitwarden server")]
Login,
@@ -214,6 +225,7 @@ impl Opt {
Self::Config { config } => {
format!("config {}", config.subcommand_name())
}
+ Self::Register => "register".to_string(),
Self::Login => "login".to_string(),
Self::Unlock => "unlock".to_string(),
Self::Unlocked => "unlocked".to_string(),
@@ -281,22 +293,23 @@ fn main(opt: Opt) {
let res = match &opt {
Opt::Config { config } => match config {
Config::Show => commands::config_show(),
- Config::Set { key, value } => commands::config_set(&key, &value),
- Config::Unset { key } => commands::config_unset(&key),
+ Config::Set { key, value } => commands::config_set(key, value),
+ Config::Unset { key } => commands::config_unset(key),
},
+ Opt::Register => commands::register(),
Opt::Login => commands::login(),
Opt::Unlock => commands::unlock(),
Opt::Unlocked => commands::unlocked(),
Opt::Sync => commands::sync(),
- Opt::List { fields } => commands::list(&fields),
+ Opt::List { fields } => commands::list(fields),
Opt::Get {
name,
user,
folder,
full,
- } => commands::get(&name, user.as_deref(), folder.as_deref(), *full),
+ } => commands::get(name, user.as_deref(), folder.as_deref(), *full),
Opt::Code { name, user, folder } => {
- commands::code(&name, user.as_deref(), folder.as_deref())
+ commands::code(name, user.as_deref(), folder.as_deref())
}
Opt::Add {
name,
@@ -304,7 +317,7 @@ fn main(opt: Opt) {
uri,
folder,
} => commands::add(
- &name,
+ name,
user.as_deref(),
uri.iter()
// XXX not sure what the ui for specifying the match type
@@ -349,18 +362,18 @@ fn main(opt: Opt) {
)
}
Opt::Edit { name, user, folder } => {
- commands::edit(&name, user.as_deref(), folder.as_deref())
+ commands::edit(name, user.as_deref(), folder.as_deref())
}
Opt::Remove { name, user, folder } => {
- commands::remove(&name, user.as_deref(), folder.as_deref())
+ commands::remove(name, user.as_deref(), folder.as_deref())
}
Opt::History { name, user, folder } => {
- commands::history(&name, user.as_deref(), folder.as_deref())
+ commands::history(name, user.as_deref(), folder.as_deref())
}
Opt::Lock => commands::lock(),
Opt::Purge => commands::purge(),
Opt::StopAgent => commands::stop_agent(),
- Opt::GenCompletions { shell } => gen_completions(&shell),
+ Opt::GenCompletions { shell } => gen_completions(shell),
}
.context(format!("rbw {}", opt.subcommand_name()));