mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Fix test_fish_sudo_parser: fix fish sudo function bugs
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/d743ec32-6ae8-41c8-b7bb-6efc63f7d346 Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
This commit is contained in:
parent
fd7e43ab0c
commit
06b2ccb88c
1 changed files with 7 additions and 8 deletions
|
|
@ -154,27 +154,26 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
|
|||
if string match -r -q -- '^--$' "$arg"
|
||||
break # end of options
|
||||
end
|
||||
if string match -r -q -- '^-[^-]*e' "$arg" or string match -q -- "--edit" "$arg"
|
||||
if string match -r -q -- '^-[^-]*e' "$arg"; or string match -q -- "--edit" "$arg"
|
||||
set cannot_set_env_var "y" # sudo -e
|
||||
break
|
||||
end
|
||||
if string match -r -q -- '^-[^-]*v' "$arg" or string match -q -- "--validate" "$arg"
|
||||
if string match -r -q -- '^-[^-]*v' "$arg"; or string match -q -- "--validate" "$arg"
|
||||
set cannot_set_env_var "y" # sudo-rs -e
|
||||
break
|
||||
end
|
||||
if string match -r -q -- '--user|--group|--host|--chdir|--chroot|--role|--type|--command-timeout|--auth-type|--login-class|--prompt|--close-from|--other-user' "$arg"
|
||||
|
||||
set ignore_arg="y"
|
||||
if string match -r -q -- '^(--user|--group|--host|--chdir|--chroot|--role|--type|--command-timeout|--auth-type|--login-class|--prompt|--close-from|--other-user)$' "$arg"
|
||||
set ignore_arg "y"
|
||||
continue
|
||||
end
|
||||
if string match -r -q -- '--.+' "$arg"
|
||||
continue
|
||||
end
|
||||
if string match -r -q -- '-.*a|-.*C|-.*c|-.*D|-.*g|-.*h|-.*p|-.*R|-.*r|-.*t|-.*T|-.*u)' "$arg"
|
||||
set ignore_arg="y"
|
||||
if string match -r -q -- '^-.*a|^-.*C|^-.*c|^-.*D|^-.*g|^-.*h|^-.*p|^-.*R|^-.*r|^-.*t|^-.*T|^-.*u' "$arg"
|
||||
set ignore_arg "y"
|
||||
continue
|
||||
end
|
||||
if string match -r -q -- '-.+' "$arg" or string match -r -q -- '.+=.+' "$arg"
|
||||
if string match -r -q -- '-.+' "$arg"; or string match -r -q -- '.+=.+' "$arg"
|
||||
continue
|
||||
end
|
||||
break # command found
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue