mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-24 17:00:32 +02:00
32997: new utility function for separated lists
This commit is contained in:
parent
5bcf00979f
commit
469ee6daef
7 changed files with 66 additions and 19 deletions
|
|
@ -688,7 +688,7 @@ if [[ "$service" = mount ]]; then
|
|||
"($excl -r -w --rw)"{-w,--rw}'[mount read/write]'
|
||||
"($excl)-L+[mount partition with specified label]:label:->labels"
|
||||
"($excl)-U+[mount partition with specified uuid]:uuid"
|
||||
"($excl -t --types)"{-t+,--types=}'[specify file system type]:file system type:->fslist'
|
||||
"($excl -t --types)"{-t+,--types=}'[specify file system type]:file system type:_sequence -s , _file_systems'
|
||||
"($excl -O --test-opts)"{-O+,--test-opts=}'[with -a, restrict filesystems by options]:file system option:->fsopt'
|
||||
"($excl -a -O -o --options)"{-o+,--options=}'[specify file system options]:file system option:->fsopt'
|
||||
'(: -)'{-B,--bind}'[remount part of filesystem elsewhere]:old directory:_directories:new directory:_directories'
|
||||
|
|
@ -743,7 +743,7 @@ if [[ "$service" = mount ]]; then
|
|||
'-o[specify file system options]:file system option:->fsopt'
|
||||
'-p[print mounted file systems]'
|
||||
'-r[mount readonly]'
|
||||
'-t[specify file system type]:file system type:->fslist'
|
||||
'-t[specify file system type]:file system type:_sequence -s, _file_systems'
|
||||
'-u[change status of already mounted filesystem]'
|
||||
'-v[verbose mode]'
|
||||
'-w[mount read/write]'
|
||||
|
|
@ -817,7 +817,7 @@ else
|
|||
'-A[unmount all mounted file systems except the root]'
|
||||
'-f[force unmount]'
|
||||
'-h[unmount all filesystems associated with host]:host:_hosts'
|
||||
'-t[unmount all filesystems of specified type]:file system type:->fslist'
|
||||
'-t[unmount all filesystems of specified type]:file system type:_sequence -s, _file_systems'
|
||||
'-v[verbose mode]'
|
||||
'*:dev or dir:->udevordir'
|
||||
)
|
||||
|
|
@ -846,11 +846,6 @@ else
|
|||
fi
|
||||
|
||||
case "$state" in
|
||||
fslist)
|
||||
compset -P '*,'
|
||||
compset -S ',*' || suf=','
|
||||
_file_systems -qS "$suf"
|
||||
;;
|
||||
fsopt)
|
||||
_tags options || return 1
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ _arguments -C \
|
|||
'-iR[scan random hosts]:num hosts' \
|
||||
'-p[specify ports to try]:port numbers' \
|
||||
'-F[scan only ports listed in services file]' \
|
||||
'-D[perform decoy scan]:host list:->host-list' \
|
||||
'-D[perform decoy scan]:host list:_sequence -s, _hosts' \
|
||||
'-S[specify source address]:address:_hosts' \
|
||||
'-e[specify interface to use]:network interface:_net_interfaces' \
|
||||
'-g[specify source port number]:port number' \
|
||||
|
|
|
|||
|
|
@ -70,13 +70,9 @@ _arguments -s -w $arguments && ret=0
|
|||
|
||||
case $state in
|
||||
(tty)
|
||||
compset -P '*,'
|
||||
|
||||
local -a used ttys
|
||||
used=(${(s:,:)IPREFIX})
|
||||
|
||||
local -a ttys
|
||||
ttys=( /dev/tty*(N) /dev/pts/*(N) )
|
||||
_wanted tty expl 'terminal device' compadd -S ',' -q -F used ${ttys#/dev/}
|
||||
_sequence -s , _wanted tty expl 'terminal device' compadd - ${ttys#/dev/}
|
||||
;;
|
||||
|
||||
(sid)
|
||||
|
|
|
|||
|
|
@ -104,11 +104,8 @@ fi
|
|||
|
||||
case $state in
|
||||
suffixes)
|
||||
compset -P '*:'
|
||||
compset -S ':*' || suf=":."
|
||||
suffixes=( *.*(N:e) )
|
||||
_wanted suffixes expl suffixes \
|
||||
compadd -S "$suf" -r ": \t" .$^suffixes && return
|
||||
_sequence -s : _wanted -x suffixes expl suffix compadd - .$^suffixes && return
|
||||
;;
|
||||
files)
|
||||
if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue