Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When copying to clipboard fails, persist anyway #9

Merged
merged 1 commit into from
Sep 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ pub fn callback_exec(matches: &getopts::Matches, store: &mut password::v2::Passw

if copy_to_clipboard(password_as_string_clipboard.deref()).is_err() {
println_ok!("Alright! Here is your password: {}", password_as_string_clipboard.deref());
return Err(1);
} else {
println_ok!("Alright! I've saved your new password. You can paste it anywhere with {}.", paste_keys());
}

println_ok!("Alright! I've saved your new password. You can paste it anywhere with {}.", paste_keys());
},
Err(err) => {
println_err!("Woops, I couldn't add the password ({:?}).", err);
Expand Down
4 changes: 2 additions & 2 deletions src/commands/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ pub fn callback_exec(matches: &getopts::Matches, store: &mut password::v2::Passw

if copy_to_clipboard(password_as_string.deref()).is_err() {
println_ok!("Alright! Here is your new password: {}", password_as_string.deref());
return Err(1);
} else {
println_ok!("Done! I've saved your new password for \"{}\". You can paste it anywhere with {}.", app_name, paste_keys());
}

println_ok!("Done! I've saved your new password for \"{}\". You can paste it anywhere with {}.", app_name, paste_keys());
Ok(())
}
Err(err) => {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ pub fn callback_exec(matches: &getopts::Matches, store: &mut password::v2::Passw

if copy_to_clipboard(password_as_string_clipboard.deref()).is_err() {
println_ok!("Alright! Here is your password: {}", password_as_string_clipboard.deref());
return Err(1);
} else {
println_ok!("Alright! I've saved your new password. You can paste it anywhere with {}.", paste_keys());
}

println_ok!("Alright! I've saved your new password. You can paste it anywhere with {}.", paste_keys());
Ok(())
},
Err(err) => {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pub fn callback_exec(matches: &getopts::Matches, store: &mut password::v2::Passw

if copy_to_clipboard(password.password.deref()).is_err() {
println_err!("Alright! Here is your password: {}", password.password.deref());
return Err(1);
} else {
println_ok!("Alright! You can paste your password anywhere with {}.", paste_keys());
}
println_ok!("Alright! You can paste your password anywhere with {}.", paste_keys());
Ok(())
},
None => {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/regenerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ pub fn callback_exec(matches: &getopts::Matches, store: &mut password::v2::Passw

if copy_to_clipboard(password_as_string.deref()).is_err() {
println_ok!("Alright! Here is your new password: {}", password_as_string.deref());
return Err(1);
} else {
println_ok!("Done! I've saved your new password for \"{}\". You can paste it anywhere with {}.", app_name, paste_keys());
}

println_ok!("Done! I've saved your new password for \"{}\". You can paste it anywhere with {}.", app_name, paste_keys());
Ok(())
}
Err(err) => {
Expand Down