aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_gnu_complete.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-01-19 02:28:53 +1000
committerGravatar axel <axel@liljencrantz.se>2007-01-19 02:28:53 +1000
commit029be823e2a406bb1f821b2753147c565b43e9b7 (patch)
tree16935bea65f8f7ca27e320119e7598e0118da815 /share/functions/__fish_gnu_complete.fish
parent421aff7d67a82aa217550fd428fcf215f55ef4dc (diff)
Remove the final non-builtin call from __fish_gnu_complete, to make it even faster
darcs-hash:20070118162853-ac50b-a31f51d53ba3121eaf6dfb4006dde00491fd53c2.gz
Diffstat (limited to 'share/functions/__fish_gnu_complete.fish')
-rw-r--r--share/functions/__fish_gnu_complete.fish35
1 files changed, 21 insertions, 14 deletions
diff --git a/share/functions/__fish_gnu_complete.fish b/share/functions/__fish_gnu_complete.fish
index 3a7fa30c..47885845 100644
--- a/share/functions/__fish_gnu_complete.fish
+++ b/share/functions/__fish_gnu_complete.fish
@@ -17,27 +17,34 @@ 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
+ switch $is_gnu
+ case 0
+ for i in $argv
- if set -q __fish_gnu_complete_skip_next
- set -e __fish_gnu_complete_skip_next
- continue
- end
+ switch $skip_next
+
+ case 1
+ set skip_next 0
+ continue
+
+ end
- switch $i
- case -l --long
- set __fish_gnu_complete_skip_next 1
- continue
+ switch $i
+
+ case -l --long
+ set skip_next 1
+ continue
+
+ end
+
+ set argv_out $argv_out $i
end
+ set argv $argv_out
- set argv_out $argv_out $i
- end
- set argv $argv_out
end
- set -e __fish_gnu_complete_skip_next
complete $argv