diff --git a/share/functions/__fish_seen_argument.fish b/share/functions/__fish_seen_argument.fish index 146e9ce8e..9774774ab 100644 --- a/share/functions/__fish_seen_argument.fish +++ b/share/functions/__fish_seen_argument.fish @@ -1,5 +1,5 @@ function __fish_seen_argument --description 'Check whether argument is used' - argparse 's/short=+' 'o/old=+' 'l/long=+' 'w/windows=+' -- $argv + argparse --ignore-unknown 's/short=+' 'o/old=+' 'l/long=+' 'w/windows=+' -- $argv set --local tokens (commandline --current-process --tokenize --cut-at-cursor) set --erase tokens[1] @@ -28,6 +28,12 @@ function __fish_seen_argument --description 'Check whether argument is used' return 0 end end + + for raw_arg in $argv + if string match --quiet -- $t $raw_arg + return 0 + end + end end return 1