aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-11 02:28:34 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-11 02:28:34 -0400
commit315643f949eb67c07186ed6ca1099add355b2cb5 (patch)
treeb18a395b28a8432befb3c57a7be778c46fdf7ef8
parentb02edb523711f5f05b5a31eae9f6adda0d177359 (diff)
downloadrbw-315643f949eb67c07186ed6ca1099add355b2cb5.tar.gz
rbw-315643f949eb67c07186ed6ca1099add355b2cb5.zip
fix errors
-rw-r--r--src/bin/rbw.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/rbw.rs b/src/bin/rbw.rs
index 9578266..e23d005 100644
--- a/src/bin/rbw.rs
+++ b/src/bin/rbw.rs
@@ -39,7 +39,7 @@ fn recv(sock: &mut std::os::unix::net::UnixStream) -> rbw::agent::Response {
serde_json::from_str(&line).unwrap()
}
-fn single_action(action: rbw::agent::Action) {
+fn single_action(action: rbw::agent::Action, desc: &str) {
let mut sock = connect();
send(
@@ -54,7 +54,7 @@ fn single_action(action: rbw::agent::Action) {
match res {
rbw::agent::Response::Ack => (),
rbw::agent::Response::Error { error } => {
- panic!("failed to login: {}", error)
+ panic!("failed to {}: {}", desc, error)
}
_ => panic!("unexpected message: {:?}", res),
}
@@ -103,19 +103,19 @@ fn config_set(key: &str, value: &str) {
fn login() {
ensure_agent();
- single_action(rbw::agent::Action::Login);
+ single_action(rbw::agent::Action::Login, "login");
}
fn unlock() {
ensure_agent();
- single_action(rbw::agent::Action::Unlock);
+ single_action(rbw::agent::Action::Unlock, "unlock");
}
fn sync() {
ensure_agent();
- single_action(rbw::agent::Action::Sync);
+ single_action(rbw::agent::Action::Sync, "sync");
}
fn list() {
@@ -179,7 +179,7 @@ fn remove() {
fn lock() {
ensure_agent();
- single_action(rbw::agent::Action::Lock);
+ single_action(rbw::agent::Action::Lock, "lock");
}
fn purge() {