1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-31 18:10:56 +01:00
zsh/Completion/Linux/Command/_fusermount
Wim de With 12b61965b5 51857: Include fusermount3 in fusermount completions
fusermount3 is part of libfuse version 3, while fusermount is part of
libfuse version 2. Since they share the exact same command line
interface, we can reuse the completions.
2023-09-20 20:21:50 +02:00

26 lines
678 B
Text

#compdef fusermount fusermount3
local expl context state line
typeset -A opt_args
_arguments \
'-h[display help information]' \
'-V[display version information]' \
'-o[specify mount options]:mount option:_fuse_values "mount option"' \
'-u[unmount a fuse mount]' \
'-z[unmount lazily (work even when if the resource is still busy)]' \
'-q[suppress nonessential output]' \
':mount point:->mountpoint' && return 0
typeset -a mtpts
case "$state" in
(mountpoint)
if [[ $+opt_args[-u] -eq 0 ]]; then
_files -/
else
mtpts=(${${${"${(f)$(< /proc/self/mounts)}"}#* }%% *})
_canonical_paths mounted 'mounted filesystem' "${(@g::)mtpts}"
fi
;;
esac