diff --git a/share/functions/__fish_gnu_complete.fish b/share/functions/__fish_gnu_complete.fish index c43d9b05e..3a7fa30c4 100644 --- a/share/functions/__fish_gnu_complete.fish +++ b/share/functions/__fish_gnu_complete.fish @@ -17,25 +17,27 @@ function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the lon set argv $argv_out set argv_out - set -l skip_next 0 # Remove long option if not on a gnu system if test $is_gnu = 0 for i in $argv - if test $skip_next = 1 + if set -q __fish_gnu_complete_skip_next + set -e __fish_gnu_complete_skip_next continue end - if test $i = -l - set skip_next 1 - continue + switch $i + case -l --long + set __fish_gnu_complete_skip_next 1 + continue end set argv_out $argv_out $i end set argv $argv_out end + set -e __fish_gnu_complete_skip_next complete $argv