diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-11-12 16:26:08 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-11-12 16:26:08 +0100 |
commit | 67c873fd3b1c62c1ca101f35516f62718e1318a8 (patch) | |
tree | 37dd07cd540865bc0d315ce5905e58504c1c7920 /src | |
parent | 8342a6c13f08d0c0f3d21594456391c7171f3cd5 (diff) |
better messages when asking a password
Diffstat (limited to 'src')
-rw-r--r-- | src/constant_strings_paths.rs | 10 | ||||
-rw-r--r-- | src/mode.rs | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/constant_strings_paths.rs b/src/constant_strings_paths.rs index b8469ac..91909d3 100644 --- a/src/constant_strings_paths.rs +++ b/src/constant_strings_paths.rs @@ -111,8 +111,14 @@ pub const FILTER_LINES: [&str; 6] = [ "a: reset", ]; /// Password input presentation for the second window -pub const PASSWORD_LINES: [&str; 1] = - ["Type your password. It will be forgotten immediatly after use."]; +pub const PASSWORD_LINES_SUDO: [&str; 2] = [ + "Type your sudo password.", + "It will be forgotten immediatly after use.", +]; +pub const PASSWORD_LINES_DEVICE: [&str; 2] = [ + "Type the device passkey.", + "It will be forgotten immediatly after use.", +]; /// Shell presentation for the second window pub const SHELL_LINES: [&str; 11] = [ "Type a shell command", diff --git a/src/mode.rs b/src/mode.rs index e302f1f..e7076c2 100644 --- a/src/mode.rs +++ b/src/mode.rs @@ -2,8 +2,9 @@ use std::fmt; use crate::completion::InputCompleted; use crate::constant_strings_paths::{ - CHMOD_LINES, FILTER_LINES, NEWDIR_LINES, NEWFILE_LINES, NVIM_ADDRESS_LINES, PASSWORD_LINES, - REGEX_LINES, REMOTE_LINES, RENAME_LINES, SHELL_LINES, SORT_LINES, + CHMOD_LINES, FILTER_LINES, NEWDIR_LINES, NEWFILE_LINES, NVIM_ADDRESS_LINES, + PASSWORD_LINES_DEVICE, PASSWORD_LINES_SUDO, REGEX_LINES, REMOTE_LINES, RENAME_LINES, + SHELL_LINES, SORT_LINES, }; use crate::cryptsetup::BlockDeviceAction; use crate::password::{PasswordKind, PasswordUsage}; @@ -109,7 +110,8 @@ impl InputSimple { Self::Filter => &FILTER_LINES, Self::Newdir => &NEWDIR_LINES, Self::Newfile => &NEWFILE_LINES, - Self::Password(_, _, _) => &PASSWORD_LINES, + Self::Password(PasswordKind::SUDO, _, _) => &PASSWORD_LINES_SUDO, + Self::Password(PasswordKind::CRYPTSETUP, _, _) => &PASSWORD_LINES_DEVICE, Self::RegexMatch => ®EX_LINES, Self::Rename => &RENAME_LINES, Self::SetNvimAddr => &NVIM_ADDRESS_LINES, |