Skip to content

Commit

Permalink
Update command_line_runner.rs (#331)
Browse files Browse the repository at this point in the history
Minor changes to wording.
  • Loading branch information
arcoast authored Sep 18, 2023
1 parent f6a4a2b commit 13f17f2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/command_line_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn start_command_line(mut args: Args) {
list_users();
let mut username = String::new();

retry_read("Please enter the username of the user you want to delete",
retry_read("Please enter the username of the user you want to update",
&mut username);
username = trim_string(username);
println!(">{}<", username);
Expand Down Expand Up @@ -296,7 +296,7 @@ fn do_user_update(mut user: User) {
let mut input = String::new();
println!("The following settings of a user should be updated: {:?}", user);
println!("Enter which field of a user should be updated [role, password, \
explicit_consent]");
consent]");
stdin().read_line(&mut input)
.expect("Error reading from terminal");
input = trim_string(input);
Expand All @@ -309,18 +309,18 @@ fn do_user_update(mut user: User) {
println!("Role updated");
}
"password" => {
let mut password = retry_read_secret("Enter the new username");
let mut password = retry_read_secret("Enter the new password");
password = digest(password);
user.password = Some(password);
User::update_user(user, &mut establish_connection())
.expect("Error updating username");
.expect("Error updating password");
println!("Password updated");
}
"explicit_consent" => {
"consent" => {
user.explicit_consent = !user.explicit_consent;
User::update_user(user, &mut establish_connection())
.expect("Error updating explicit_consent");
println!("Explicit consent updated");
.expect("Error switching consent");
println!("Consent preference switched");
}
_ => {
println!("Field not found");
Expand Down Expand Up @@ -359,4 +359,4 @@ pub fn create_debug_message() {
println!("Error: {:?}", e);
}
}
}
}

0 comments on commit 13f17f2

Please sign in to comment.