mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
rewrite: removed unneeded operations
This commit is contained in:
parent
10a23a7e09
commit
18f5627587
1 changed files with 2 additions and 3 deletions
|
|
@ -23,9 +23,8 @@ fn last_command(shell: &str) -> String {
|
||||||
let last_command = std::env::var("_PR_LAST_COMMAND").expect("No _PR_LAST_COMMAND in environment. Did you aliased the command with the correct argument?");
|
let last_command = std::env::var("_PR_LAST_COMMAND").expect("No _PR_LAST_COMMAND in environment. Did you aliased the command with the correct argument?");
|
||||||
match shell {
|
match shell {
|
||||||
"bash" => {
|
"bash" => {
|
||||||
let first_line = last_command.lines().next().unwrap();
|
let first_line = last_command.lines().next().unwrap().trim();
|
||||||
let split = first_line.split_whitespace().collect::<Vec<&str>>();
|
first_line.split_once(" ").unwrap().1.to_string()
|
||||||
split[1..].join(" ")
|
|
||||||
}
|
}
|
||||||
"zsh" => last_command,
|
"zsh" => last_command,
|
||||||
"fish" => last_command,
|
"fish" => last_command,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue