about summary refs log tree commit diff
path: root/Completion/Linux/Type/_fuse_arguments
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Linux/Type/_fuse_arguments')
-rw-r--r--Completion/Linux/Type/_fuse_arguments53
1 files changed, 53 insertions, 0 deletions
diff --git a/Completion/Linux/Type/_fuse_arguments b/Completion/Linux/Type/_fuse_arguments
new file mode 100644
index 000000000..ea705a2d0
--- /dev/null
+++ b/Completion/Linux/Type/_fuse_arguments
@@ -0,0 +1,53 @@
+#autoload
+
+local ret long rawret nm=${compstate[nmatches]} fsopt cvalsvar
+typeset -a fargs opts
+
+fargs=(
+  '(-d -f)-d[enable debug output]'
+  '-f[enable foreground operation]'
+  '-r[mount filesystem read-only]'
+  '-s[disable multi-threaded operation]'
+  '(-h --help)'{-h,--help}'[display help and exit]'
+  '(-V --version)'{-V,--version}'[show version information and exit]'
+)
+
+(( $# )) || fargs+='*:default: _default'
+
+long=$argv[(I)--]
+if (( long )); then
+  argv[long]=($fargs --)
+else
+  set -- $@ $fargs
+fi
+
+while [[ $1 == -(O*|F*|[CRWsw]) ]]; do
+  if [[ $1 == -F?* ]]; then
+    cvalsvar=${1[3,-1]}
+  elif [[ $1 == -F ]]; then
+    cvalsvar=$2
+    shift
+  else
+    opts+=$1
+    [[ $1 == -R ]] && rawret=yes
+  fi
+  shift
+done
+
+if [[ $cvalsvar != - ]]; then
+  fsopt='*-o[specify mount options]:mount option:_fuse_values'
+  [[ -n $cvalsvar ]] && fsopt+=" -A $cvalsvar"
+  fsopt+=' mount\ option'
+  set -- $@ $fsopt
+fi
+
+_arguments -R $opts $@
+
+ret=$?
+
+if [[ $ret == 300 ]]; then
+  compstate[restore]=
+  [[ -z $rawret ]] && ret=$(( nm == $compstate[nmatches] ))
+fi
+
+return ret