1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-02 06:40:55 +01:00

fix for comparguments (completing after single letter options that get their argument in the next word); make _values ignore some of the standard option it may get; make _mount use _dir_list in some places and improve that; `document' comparguments and compvalues with some comments in computil.c (14897)

This commit is contained in:
Sven Wischnowsky 2001-06-13 11:05:51 +00:00
parent 1bb5d4d385
commit 71a9847d48
5 changed files with 98 additions and 15 deletions

View file

@ -444,7 +444,7 @@ if [[ "$service" = mount ]]; then
irix*)
args=( -s
'-a[mount all filesystems in /etc/fstab]'
'-b[mount all filesystems in /etc/fstab except those listed]:list of directories:_files -/ -S,'
'-b[mount all filesystems in /etc/fstab except those listed]:list of directories:_dir_list -s,'
'-c[check any dirty filesystems before mounting]'
'-f[fake a new /etc/mtab entry, but don'\''t mount any filesystems]'
'-h[mount all filesystems associated with host]:hostnames:_hosts'
@ -575,7 +575,7 @@ else
irix*)
args=(
'-a[unmount all mounted file systems]'
'-b[unmount all filesystems in /etc/fstab except those listed]:list of directories:_files -/ -S,'
'-b[unmount all filesystems in /etc/fstab except those listed]:list of directories:_dir_list -s,'
'-h[unmount all filesystems associated with host]:hostnames:_hosts'
'-k[kill all processes with files open on filesystems before unmounting]'
'-t[unmount all filesystems of specified type]:file system type:->fstype'

View file

@ -1,7 +1,27 @@
#autoload
local suf
# options:
# -s <sep> to specify the separator (default is a colon)
# -S to say that the separator should be added as a suffix (instead
# of the default slash)
compset -P '*:'
compset -S ':*' || suf=":"
_files -S "$suf" -r ': \t\t\-' -/
local sep=: dosuf suf
while [[ "$1" = -(s*|S) ]]; do
case "$1" in
-s) sep="$2"; shift 2;;
-s*) sep="${1[3,-1]}"; shift;;
-S) dosuf=yes; shift;;
esac
done
compset -P "*${sep}"
compset -S "${sep}*" || suf="$sep"
if [[ -n "$dosuf" ]]; then
suf=(-S "$suf")
else
suf=()
fi
_files "$suf[@]" -r "${sep}"' /\t\t\-' -/ "$@"