mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
refactor: underscoring preserved command names
This commit is contained in:
parent
eb66bc2c24
commit
e1586db6af
3 changed files with 4 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
command = "general"
|
||||
command = "_PR_general"
|
||||
|
||||
[[match_err]]
|
||||
pattern = [
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
command = "privilege"
|
||||
command = "_PR_privilege"
|
||||
|
||||
[[match_err]]
|
||||
pattern = [
|
||||
|
|
@ -19,7 +19,7 @@ pub fn suggest_command(shell: &str, last_command: &str, error_msg: &str) -> Opti
|
|||
};
|
||||
|
||||
if !PRIVILEGE_LIST.contains(&executable) {
|
||||
let suggest = match_pattern("privilege", last_command, error_msg, shell);
|
||||
let suggest = match_pattern("_PR_privilege", last_command, error_msg, shell);
|
||||
if suggest.is_some() {
|
||||
return suggest;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ pub fn suggest_command(shell: &str, last_command: &str, error_msg: &str) -> Opti
|
|||
return Some(suggest);
|
||||
}
|
||||
|
||||
let suggest = match_pattern("general", last_command, error_msg, shell);
|
||||
let suggest = match_pattern("_PR_general", last_command, error_msg, shell);
|
||||
if let Some(suggest) = suggest {
|
||||
if PRIVILEGE_LIST.contains(&split_command[0].as_str()) {
|
||||
return Some(format!("{} {}", split_command[0], suggest));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue