aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_gnu_complete.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-17 20:13:39 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-17 20:13:39 +1000
commit343cafef346543282b5b6e825bc8f9dd10028a48 (patch)
tree1bcf221ecb525c7aeadc8325e7b780d3656e544b /share/functions/__fish_gnu_complete.fish
parent95a01f3c8f15034433ffce368d8f2d13d925139c (diff)
Redo installation file structure, move lots of things to $PREFIX/share/fish
darcs-hash:20060217101339-ac50b-d93d2c620a4b7f75f05ff461a6edbee001da7613.gz
Diffstat (limited to 'share/functions/__fish_gnu_complete.fish')
-rw-r--r--share/functions/__fish_gnu_complete.fish29
1 files changed, 29 insertions, 0 deletions
diff --git a/share/functions/__fish_gnu_complete.fish b/share/functions/__fish_gnu_complete.fish
new file mode 100644
index 00000000..9aeb0ba8
--- /dev/null
+++ b/share/functions/__fish_gnu_complete.fish
@@ -0,0 +1,29 @@
+function __fish_gnu_complete -d "Wrapper for the complete builtin. Skips the long completions on non-GNU systems"
+ set is_gnu 0
+
+ # Check if we are using a gnu system
+ for i in (seq (count $argv))
+ switch $argv[$i]
+
+ case -g --is-gnu
+ set -e argv[$i]
+ set is_gnu 1
+ break
+ end
+ end
+
+ # Remove long option if not on a gnu system
+ if test $is_gnu = 0
+ for i in (seq (count $argv))
+ if test $argv[$i] = -l
+ set -e argv[$i]
+ set -e argv[$i]
+ break
+ end
+ end
+ end
+
+ complete $argv
+
+end
+