mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
fix: leading space after privilege command
This commit is contained in:
parent
c7df749278
commit
d8c076dcf7
1 changed files with 10 additions and 7 deletions
|
|
@ -137,12 +137,6 @@ impl Data {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
{
|
|
||||||
eprintln!("modules: {:?}", modules);
|
|
||||||
eprintln!("fallbacks: {:?}", fallbacks);
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut init = Data {
|
let mut init = Data {
|
||||||
shell,
|
shell,
|
||||||
command,
|
command,
|
||||||
|
|
@ -160,6 +154,15 @@ impl Data {
|
||||||
|
|
||||||
init.split();
|
init.split();
|
||||||
init.update_error(None);
|
init.update_error(None);
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)] {
|
||||||
|
eprintln!("shell: {}", init.shell);
|
||||||
|
eprintln!("command: {}", init.command);
|
||||||
|
eprintln!("error: {}", init.error);
|
||||||
|
eprintln!("modules: {:?}", init.modules);
|
||||||
|
eprintln!("fallbacks: {:?}", init.fallbacks);
|
||||||
|
}
|
||||||
|
|
||||||
init
|
init
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +193,7 @@ impl Data {
|
||||||
pub fn split(&mut self) {
|
pub fn split(&mut self) {
|
||||||
let mut split = split_command(&self.command);
|
let mut split = split_command(&self.command);
|
||||||
if PRIVILEGE_LIST.contains(&split[0].as_str()) {
|
if PRIVILEGE_LIST.contains(&split[0].as_str()) {
|
||||||
self.command = self.command.replacen(&split[0], "", 1);
|
self.command = self.command.replacen(&split[0], "", 1).trim().to_string();
|
||||||
self.privilege = Some(split.remove(0))
|
self.privilege = Some(split.remove(0))
|
||||||
}
|
}
|
||||||
self.split = split;
|
self.split = split;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue