Files
fish-shell/share/functions/__fish_gnu_complete.fish
axel 81e0fcbc13 Additional performance tweak for __fish_gnu_complete
darcs-hash:20070116125116-ac50b-0a702bc02f9a126b36505864dcc597661a7ca2b0.gz
2007-01-16 22:51:16 +10:00

46 lines
754 B
Fish

function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the long completions on non-GNU systems"
set is_gnu 0
set -l argv_out
# Check if we are using a gnu system
for i in $argv
switch $i
case -g --is-gnu
set is_gnu 1
case '*'
set argv_out $argv_out $i
end
end
set argv $argv_out
set argv_out
# Remove long option if not on a gnu system
if test $is_gnu = 0
for i in $argv
if set -q __fish_gnu_complete_skip_next
set -e __fish_gnu_complete_skip_next
continue
end
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
end