mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 04:30:24 +02:00
another fix for 15477 (separator strings); add list-separator style (15484)
This commit is contained in:
parent
e1708022d2
commit
c83d16f8ee
9 changed files with 41 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
#compdef lscfg
|
||||
|
||||
local state line expl curcontext="$curcontext" disp list devs
|
||||
local state line expl curcontext="$curcontext" disp list devs sep
|
||||
|
||||
_arguments -C -s \
|
||||
'-l[display device information for named device]:device:->device' \
|
||||
|
@ -9,7 +9,8 @@ _arguments -C -s \
|
|||
if [[ "$state" = device ]]; then
|
||||
devs=( ${${${${(f)"$(lscfg)"}[6,-1]:# *}##??}/ ##[^ ]# #/:} )
|
||||
if zstyle -T ":completion:${curcontext}:devices" verbose; then
|
||||
zformat -a list ' -- ' "$devs[@]"
|
||||
zstyle -s ":completion:${curcontext}:devices" list-separator sep || sep=--
|
||||
zformat -a list " $sep " "$devs[@]"
|
||||
disp=(-ld list)
|
||||
else
|
||||
disp=()
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#autoload
|
||||
|
||||
local expl list names disp
|
||||
local expl list names disp sep
|
||||
|
||||
list=( $(lsvg -l $(lsvg)|sed -e '2d'|awk '/[^:]* / {if ( $7 != "N/A" ) print $1 ":" $7; else print $1}' ) )
|
||||
names=(${list%%:*})
|
||||
if zstyle -T ":completion:${curcontext}" verbose; then
|
||||
zformat -a list ' -- ' $list
|
||||
if zstyle -T ":completion:${curcontext}:" verbose; then
|
||||
zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
|
||||
zformat -a list " $sep " $list
|
||||
disp=(-d list)
|
||||
else
|
||||
disp=()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue