mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-12-13 08:01:27 +01:00
use basename of commands instead of $words[1]
This commit is contained in:
parent
fc426939cc
commit
b8bdb144d2
19 changed files with 1509 additions and 708 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -4,6 +4,16 @@
|
||||||
|
|
||||||
2000-04-05 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
|
2000-04-05 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
|
||||||
|
|
||||||
|
* 10511: Completion/Debian/_apt, Completion/Debian/_bug,
|
||||||
|
Completion/Debian/_dpkg, Completion/User/_chown,
|
||||||
|
Completion/User/_dvi, Completion/User/_imagemagick,
|
||||||
|
Completion/User/_ispell, Completion/User/_lp,
|
||||||
|
Completion/User/_mount, Completion/User/_mysql_utils,
|
||||||
|
Completion/User/_pbm, Completion/User/_psutils,
|
||||||
|
Completion/User/_rcs, Completion/User/_rlogin,
|
||||||
|
Completion/User/_ssh, Completion/User/_tiff, Completion/User/_yp,:
|
||||||
|
Completion/X/_xutils: use basename of commands instead of $words[1]
|
||||||
|
|
||||||
* 10508: Completion/Builtins/_zstyle, Completion/Core/_path_files,
|
* 10508: Completion/Builtins/_zstyle, Completion/Core/_path_files,
|
||||||
Doc/Zsh/compsys.yo, Functions/Zle/incremental-complete-word:
|
Doc/Zsh/compsys.yo, Functions/Zle/incremental-complete-word:
|
||||||
renaming some styles
|
renaming some styles
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#compdef apt-get apt-cache apt-cdrom apt-config
|
#compdef apt-get apt-cache apt-cdrom apt-config
|
||||||
|
|
||||||
_apt () {
|
_apt () {
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
apt-get) _apt-get "$@";;
|
apt-get) _apt-get "$@";;
|
||||||
apt-cache) _apt-cache "$@";;
|
apt-cache) _apt-cache "$@";;
|
||||||
apt-cdrom) _apt-cdrom "$@";;
|
apt-cdrom) _apt-cdrom "$@";;
|
||||||
|
|
@ -17,7 +17,7 @@ _apt_arguments () {
|
||||||
funcname="$1"
|
funcname="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
typeset -A canonicalize options
|
typeset -A canonicalize num_options
|
||||||
local short_hasarg short_bool short_intlevel short_configfile short_arbitem
|
local short_hasarg short_bool short_intlevel short_configfile short_arbitem
|
||||||
local long_hasarg long_bool long_intlevel long_configfile long_arbitem
|
local long_hasarg long_bool long_intlevel long_configfile long_arbitem
|
||||||
local comp_hasarg=''
|
local comp_hasarg=''
|
||||||
|
|
@ -28,11 +28,11 @@ _apt_arguments () {
|
||||||
type="${1#*:}"
|
type="${1#*:}"
|
||||||
|
|
||||||
case $type in
|
case $type in
|
||||||
bool) options[$opts]=1;;
|
bool) num_options[$opts]=1;;
|
||||||
intlevel) options[$opts]=-1;;
|
intlevel) num_options[$opts]=-1;;
|
||||||
configfile) options[$opts]=1;;
|
configfile) num_options[$opts]=1;;
|
||||||
arbitem) options[$opts]=-1;;
|
arbitem) num_options[$opts]=-1;;
|
||||||
*) options[$opts]=1
|
*) num_options[$opts]=1
|
||||||
comp_hasarg="${comp_hasarg}$opts) $type;;"$'\n'
|
comp_hasarg="${comp_hasarg}$opts) $type;;"$'\n'
|
||||||
type=hasarg;;
|
type=hasarg;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -54,7 +54,7 @@ _apt_arguments () {
|
||||||
case \$current_option in
|
case \$current_option in
|
||||||
${comp_hasarg}esac"
|
${comp_hasarg}esac"
|
||||||
|
|
||||||
local short_seq false true bool __bool_ intlevel word word1 nul
|
local short_seq false true bool bool_prefix intlevel word word1 nul qnul
|
||||||
local comp_bool comp_intlevel comp_configfile comp_arbitem comp_long comp_opt
|
local comp_bool comp_intlevel comp_configfile comp_arbitem comp_long comp_opt
|
||||||
local regex_short regex_long regex_all
|
local regex_short regex_long regex_all
|
||||||
|
|
||||||
|
|
@ -66,15 +66,16 @@ _apt_arguments () {
|
||||||
true=(yes true with on enable)
|
true=(yes true with on enable)
|
||||||
bool=($false $true)
|
bool=($false $true)
|
||||||
|
|
||||||
__bool_=(--${^bool}-)
|
bool_prefix=(--${^bool}-)
|
||||||
|
|
||||||
intlevel='[0-9]##'
|
intlevel='[0-9]##'
|
||||||
|
|
||||||
word=$'[^\0]#\0'
|
word=$'[^\0]#\0'
|
||||||
word1=$'[^\0]##\0'
|
word1=$'[^\0]##\0'
|
||||||
nul=$'\0'
|
nul=$'\0'
|
||||||
|
qnul="\$'\\0'"
|
||||||
|
|
||||||
comp_bool='compadd "$expl_bool[@]" '"$bool"
|
comp_bool='_wanted values && compadd "$expl_bool[@]" '"$bool"
|
||||||
comp_intlevel= #"_message 'intlevel'"
|
comp_intlevel= #"_message 'intlevel'"
|
||||||
comp_configfile='_files "$expl_configfile[@]"'
|
comp_configfile='_files "$expl_configfile[@]"'
|
||||||
comp_arbitem= #"_message 'Foo::Bar=bar'"
|
comp_arbitem= #"_message 'Foo::Bar=bar'"
|
||||||
|
|
@ -82,38 +83,30 @@ _apt_arguments () {
|
||||||
comp_short=\
|
comp_short=\
|
||||||
'if [[ $PREFIX = -'"$short_seq"' ]]; then
|
'if [[ $PREFIX = -'"$short_seq"' ]]; then
|
||||||
_apt_consume_short ${PREFIX[2,-1]}
|
_apt_consume_short ${PREFIX[2,-1]}
|
||||||
tmp1=(${${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}#-})
|
tmp1=(${(M)${(s:,:)${(kj:,:)num_options[(R)*~0]}}:#-?})
|
||||||
if [[ $PREFIX = - ]]; then
|
tmp2=(${PREFIX}${^tmp1#-})
|
||||||
compadd "$expl_opt[@]" - -${^tmp1}
|
_describe -o option tmp1 tmp2
|
||||||
else
|
|
||||||
tmp2=(-${^tmp1})
|
|
||||||
compadd "$expl_opt[@]" -y "($tmp2)" - ${PREFIX}${^tmp1}
|
|
||||||
fi
|
|
||||||
elif [[ -z "$PREFIX" ]]; then
|
elif [[ -z "$PREFIX" ]]; then
|
||||||
compadd "$expl_opt[@]" - ${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}
|
tmp1=(${(M)${(s:,:)${(kj:,:)num_options[(R)*~0]}}:#-?})
|
||||||
|
_describe -o option tmp1
|
||||||
fi'
|
fi'
|
||||||
|
|
||||||
comp_long=\
|
comp_long=\
|
||||||
'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}"
|
'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)num_options[(R)*~0]}}:#--*}#--}}"
|
||||||
tmp2=(--${(M)^long_bool:#$~tmp1} --${(M)^long_intlevel:#$~tmp1})
|
tmp2=(--${(M)^long_bool:#$~tmp1} --${(M)^long_intlevel:#$~tmp1})
|
||||||
compadd "$expl_opt[@]" - $tmp2
|
tmp3=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1})
|
||||||
tmp2=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1})
|
_describe -o option tmp2 -- tmp3 -S= -- bool_prefix -S ""'
|
||||||
compadd "$expl_opt[@]" -S= - $tmp2
|
|
||||||
compadd "$expl_opt[@]" -S "" - '"$__bool_"
|
|
||||||
|
|
||||||
comp_long_prefix=\
|
comp_long_prefix=\
|
||||||
'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}"
|
'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)num_options[(R)*~0]}}:#--*}#--}}"
|
||||||
tmp2=($_ra_left${(M)^long_bool:#$~tmp1} $_ra_left${(M)^long_intlevel:#$~tmp1})
|
tmp2=($_ra_left${(M)^long_bool:#$~tmp1} $_ra_left${(M)^long_intlevel:#$~tmp1})
|
||||||
compadd "$expl_opt[@]" - $tmp2
|
tmp3=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1})
|
||||||
tmp2=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1})
|
tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)num_options[(R)*~0]}}:#-?}#-}}"
|
||||||
compadd "$expl_opt[@]" -S= - $tmp2
|
tmp2=("$tmp2[@]" $_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1})
|
||||||
tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#-?}#-}}"
|
tmp3=("$tmp3[@]" $_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1})
|
||||||
tmp2=($_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1})
|
_describe -o option tmp2 -- tmp3 -S='
|
||||||
compadd "$expl_opt[@]" - $tmp2
|
|
||||||
tmp2=($_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1})
|
|
||||||
compadd "$expl_opt[@]" -S= - $tmp2'
|
|
||||||
|
|
||||||
comp_opt='[[ -prefix - || -z "$compconfig[option_prefix]" ]]'" && { $comp_short; $comp_long }"
|
comp_opt='{ ! zstyle -T ":completion:${curcontext}:options" prefix-needed || [[ "$PREFIX" = -* ]] }'" && { $comp_short; $comp_long }"
|
||||||
|
|
||||||
regex_short=()
|
regex_short=()
|
||||||
regex_long=()
|
regex_long=()
|
||||||
|
|
@ -121,206 +114,204 @@ compadd "$expl_opt[@]" -S= - $tmp2'
|
||||||
|
|
||||||
if (( $#short_hasarg )); then
|
if (( $#short_hasarg )); then
|
||||||
regex_short=("$regex_short[@]"
|
regex_short=("$regex_short[@]"
|
||||||
/"$short_seq(${(j:|:)short_hasarg})(=|)"
|
/"$short_seq(${(j:|:)short_hasarg})(=|)"/
|
||||||
-'_apt_consume_short ${_ra_match%=}; current_option=${canonicalize[-${${_ra_match%=}[-1]}]}'
|
-'_apt_consume_short ${match[1]%=}; current_option=${canonicalize[-${${match[1]%=}[-1]}]}'
|
||||||
\( /"$word1" !"$comp_hasarg" \| /"$nul" /"$word" !"$comp_hasarg" \) \|
|
\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)short_hasarg})$nul"
|
/"(${(j:|:)short_hasarg})$nul"/
|
||||||
-'_apt_consume_short ${_ra_match[-2]}; current_option=${canonicalize[-${${_ra_match%$nul}[-1]}]}'
|
-'_apt_consume_short ${match[1][-2]}; current_option=${canonicalize[-${${match[1]%'$qnul'}[-1]}]}'
|
||||||
/"$word" !"$comp_hasarg" \|
|
/"$word"/ :"$comp_hasarg" \|
|
||||||
/"(${(j:|:)short_hasarg})="
|
/"(${(j:|:)short_hasarg})="/
|
||||||
-'_apt_consume_short ${_ra_match[-2]}; current_option=${canonicalize[-${${_ra_match%=}[-1]}]}'
|
-'_apt_consume_short ${match[1][-2]}; current_option=${canonicalize[-${${match[1]%=}[-1]}]}'
|
||||||
\( /"$word1" !"$comp_hasarg" \| /"$nul" /"$word" !"$comp_hasarg" \) \|
|
\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#short_bool )); then
|
if (( $#short_bool )); then
|
||||||
regex_short=("$regex_short[@]"
|
regex_short=("$regex_short[@]"
|
||||||
/"$short_seq(${(j:|:)short_bool})($nul(${(j:|:)bool})|(${(j:|:)bool})|)$nul"
|
/"$short_seq(${(j:|:)short_bool})($nul(${(j:|:)bool})|(${(j:|:)bool})|)$nul"/
|
||||||
-"_apt_consume_short \${_ra_match%%($nul(${(j:|:)bool})|(${(j:|:)bool})|)$nul}" \|
|
-'_apt_consume_short ${match[1]%%('$qnul'('${(j:|:)bool}')|('${(j:|:)bool}')|)'$qnul'}' \|
|
||||||
/"$short_seq(${(j:|:)short_bool})="
|
/"$short_seq(${(j:|:)short_bool})="/
|
||||||
-"_apt_consume_short \${_ra_match%=}"
|
-'_apt_consume_short ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_bool" \| /"$nul" /"$word" !"$comp_bool" \) \|
|
\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)short_bool})="
|
/"(${(j:|:)short_bool})="/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
\( /"$word1" !"$comp_bool" \| /"$nul" /"$word" !"$comp_bool" \) \|
|
\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
|
||||||
/"(${(j:|:)short_bool})$nul"
|
/"(${(j:|:)short_bool})$nul"/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
/"((${(j:|:)bool})$nul|)" !"$comp_bool" \|
|
/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#short_intlevel )); then
|
if (( $#short_intlevel )); then
|
||||||
regex_short=("$regex_short[@]"
|
regex_short=("$regex_short[@]"
|
||||||
/"$short_seq(${(j:|:)short_intlevel})($nul$intlevel|$intlevel|)$nul"
|
/"$short_seq(${(j:|:)short_intlevel})($nul$intlevel|$intlevel|)$nul"/
|
||||||
-"_apt_consume_short \${_ra_match%%($nul$intlevel|$intlevel|)$nul}" \|
|
-'_apt_consume_short ${match[1]%%'"($qnul$intlevel|$intlevel|)$qnul"'}' \|
|
||||||
/"$short_seq(${(j:|:)short_intlevel})="
|
/"$short_seq(${(j:|:)short_intlevel})="/
|
||||||
-"_apt_consume_short \${_ra_match%=}"
|
-'_apt_consume_short ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_intlevel" \| /"$nul" /"$word" !"$comp_intlevel" \) \|
|
\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)short_intlevel})="
|
/"(${(j:|:)short_intlevel})="/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
\( /"$word1" !"$comp_intlevel" \| /"$nul" /"$word" !"$comp_intlevel" \) \|
|
\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
|
||||||
/"(${(j:|:)short_intlevel})$nul"
|
/"(${(j:|:)short_intlevel})$nul"/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
/"($intlevel$nul|)" !"$comp_intlevel" \|
|
/"($intlevel$nul|)"/ :"$comp_intlevel" \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#short_configfile )); then
|
if (( $#short_configfile )); then
|
||||||
regex_short=("$regex_short[@]"
|
regex_short=("$regex_short[@]"
|
||||||
/"$short_seq(${(j:|:)short_configfile})(=|)"
|
/"$short_seq(${(j:|:)short_configfile})(=|)"/
|
||||||
-"_apt_consume_short \${_ra_match%=}"
|
-'_apt_consume_short ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_configfile" \| /"$nul" /"$word" !"$comp_configfile" \) \|
|
\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)short_configfile})$nul"
|
/"(${(j:|:)short_configfile})$nul"/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
/"$word" !"$comp_configfile" \|
|
/"$word"/ :"$comp_configfile" \|
|
||||||
/"(${(j:|:)short_configfile})="
|
/"(${(j:|:)short_configfile})="/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
\( /"$word1" !"$comp_configfile" \| /"$nul" /"$word" !"$comp_configfile" \) \|
|
\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#short_arbitem )); then
|
if (( $#short_arbitem )); then
|
||||||
regex_short=("$regex_short[@]"
|
regex_short=("$regex_short[@]"
|
||||||
/"$short_seq(${(j:|:)short_arbitem})(=|)"
|
/"$short_seq(${(j:|:)short_arbitem})(=|)"/
|
||||||
-"_apt_consume_short \${_ra_match%=}"
|
-'_apt_consume_short ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_arbitem" \| /"$nul" /"$word" !"$comp_arbitem" \) \|
|
\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)short_arbitem})$nul"
|
/"(${(j:|:)short_arbitem})$nul"/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
/"$word" !"$comp_arbitem" \|
|
/"$word"/ :"$comp_arbitem" \|
|
||||||
/"(${(j:|:)short_arbitem})="
|
/"(${(j:|:)short_arbitem})="/
|
||||||
-"_apt_consume_short \${_ra_match[-2]}"
|
-'_apt_consume_short ${match[1][-2]}'
|
||||||
\( /"$word1" !"$comp_arbitem" \| /"$nul" /"$word" !"$comp_arbitem" \) \|
|
\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#long_hasarg )); then
|
if (( $#long_hasarg )); then
|
||||||
regex_long=("$regex_long[@]"
|
regex_long=("$regex_long[@]"
|
||||||
/"(${(j:|:)long_hasarg})$nul"
|
/"(${(j:|:)long_hasarg})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}; current_option=\${canonicalize[--\${_ra_match%$nul}]}"
|
-'_apt_consume_long ${match[1]%'$qnul'}; current_option=${canonicalize[--${match[1]%'$qnul'}]}'
|
||||||
/"$word" !"$comp_hasarg" \|
|
/"$word"/ :"$comp_hasarg" \|
|
||||||
/"(${(j:|:)long_hasarg})="
|
/"(${(j:|:)long_hasarg})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}; current_option=\${canonicalize[--\${_ra_match%=}]}"
|
-'_apt_consume_long ${match[1]%=}; current_option=${canonicalize[--${match[1]%=}]}'
|
||||||
\( /"$word1" !"$comp_hasarg" \| /"$nul" /"$word" !"$comp_hasarg" \) \|
|
\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)long_hasarg})$nul"
|
/"(${(j:|:)long_hasarg})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}; current_option=\${canonicalize[--\${_ra_match%$nul}]}"
|
-'_apt_consume_long ${match[1]%'$qnul'}; current_option=${canonicalize[--${match[1]%'$qnul'}]}'
|
||||||
/"$word" !"$comp_hasarg" \|
|
/"$word"/ :"$comp_hasarg" \|
|
||||||
/"(${(j:|:)long_hasarg})="
|
/"(${(j:|:)long_hasarg})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}; current_option=\${canonicalize[--\${_ra_match%=}]}"
|
-'_apt_consume_long ${match[1]%=}; current_option=${canonicalize[--${match[1]%=}]}'
|
||||||
\( /"$word1" !"$comp_hasarg" \| /"$nul" /"$word" !"$comp_hasarg" \) \|
|
\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#long_bool )); then
|
if (( $#long_bool )); then
|
||||||
regex_long=("$regex_long[@]"
|
regex_long=("$regex_long[@]"
|
||||||
/"(${(j:|:)long_bool})="
|
/"(${(j:|:)long_bool})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_bool" \| /"$nul" /"$word" !"$comp_bool" \) \|
|
\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
|
||||||
/"(${(j:|:)long_bool})$nul"
|
/"(${(j:|:)long_bool})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"((${(j:|:)bool})$nul|)" !"$comp_bool" \|
|
/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)long_bool})="
|
/"(${(j:|:)long_bool})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_bool" \| /"$nul" /"$word" !"$comp_bool" \) \|
|
\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
|
||||||
/"(${(j:|:)long_bool})$nul"
|
/"(${(j:|:)long_bool})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"((${(j:|:)bool})$nul|)" !"$comp_bool" \|
|
/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#long_intlevel )); then
|
if (( $#long_intlevel )); then
|
||||||
regex_long=("$regex_long[@]"
|
regex_long=("$regex_long[@]"
|
||||||
/"(${(j:|:)long_intlevel})="
|
/"(${(j:|:)long_intlevel})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_intlevel" \| /"$nul" /"$word" !"$comp_intlevel" \) \|
|
\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
|
||||||
/"(${(j:|:)long_intlevel})$nul"
|
/"(${(j:|:)long_intlevel})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"($intlevel$nul|)" !"$comp_intlevel" \|
|
/"($intlevel$nul|)"/ :"$comp_intlevel" \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)long_intlevel})$nul"
|
/"(${(j:|:)long_intlevel})="/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
/"$intlevel" !"$comp_intlevel" /"$nul" \|
|
\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
|
||||||
/"(${(j:|:)long_intlevel})="
|
/"(${(j:|:)long_intlevel})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
\( /"$word1" !"$comp_intlevel" \| /"$nul" /"$word" !"$comp_intlevel" \) \|
|
/"($intlevel$nul|)"/ :"$comp_intlevel" \|
|
||||||
/"(${(j:|:)long_intlevel})$nul"
|
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
|
||||||
/"($intlevel$nul|)" !"$comp_intlevel" \|
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#long_configfile )); then
|
if (( $#long_configfile )); then
|
||||||
regex_long=("$regex_long[@]"
|
regex_long=("$regex_long[@]"
|
||||||
/"(${(j:|:)long_configfile})$nul"
|
/"(${(j:|:)long_configfile})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"$word" !"$comp_configfile" \|
|
/"$word"/ :"$comp_configfile" \|
|
||||||
/"(${(j:|:)long_configfile})="
|
/"(${(j:|:)long_configfile})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_configfile" \| /"$nul" /"$word" !"$comp_configfile" \) \|
|
\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)long_configfile})$nul"
|
/"(${(j:|:)long_configfile})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"$word" !"$comp_configfile" \|
|
/"$word"/ :"$comp_configfile" \|
|
||||||
/"(${(j:|:)long_configfile})="
|
/"(${(j:|:)long_configfile})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_configfile" \| /"$nul" /"$word" !"$comp_configfile" \) \|
|
\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $#long_arbitem )); then
|
if (( $#long_arbitem )); then
|
||||||
regex_long=("$regex_long[@]"
|
regex_long=("$regex_long[@]"
|
||||||
/"(${(j:|:)long_arbitem})$nul"
|
/"(${(j:|:)long_arbitem})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"$word" !"$comp_arbitem" \|
|
/"$word"/ :"$comp_arbitem" \|
|
||||||
/"(${(j:|:)long_arbitem})="
|
/"(${(j:|:)long_arbitem})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_arbitem" \| /"$nul" /"$word" !"$comp_arbitem" \) \|
|
\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
|
||||||
)
|
)
|
||||||
regex_long_prefix=("$regex_long_prefix[@]"
|
regex_long_prefix=("$regex_long_prefix[@]"
|
||||||
/"(${(j:|:)long_arbitem})$nul"
|
/"(${(j:|:)long_arbitem})$nul"/
|
||||||
-"_apt_consume_long \${_ra_match%$nul}"
|
-'_apt_consume_long ${match[1]%'$qnul'}'
|
||||||
/"$word" !"$comp_arbitem" \|
|
/"$word"/ :"$comp_arbitem" \|
|
||||||
/"(${(j:|:)long_arbitem})="
|
/"(${(j:|:)long_arbitem})="/
|
||||||
-"_apt_consume_long \${_ra_match%=}"
|
-'_apt_consume_long ${match[1]%=}'
|
||||||
\( /"$word1" !"$comp_arbitem" \| /"$nul" /"$word" !"$comp_arbitem" \) \|
|
\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
regex_all=(
|
regex_all=(
|
||||||
/"$word"
|
/"$word"/
|
||||||
\( %-- \( "$regex_long[@]"
|
\( /--/+ \( "$regex_long[@]"
|
||||||
%"(${(j:|:)bool})-"
|
/"(${(j:|:)bool})-"/+
|
||||||
\( "$regex_long_prefix[@]" /"[]" !"$comp_long_prefix" \) \|
|
\( "$regex_long_prefix[@]"
|
||||||
/"[]" !"$comp_long" \) \|
|
/"[]"/ :"$comp_long_prefix" \) \) \|
|
||||||
%- \( "$regex_short[@]" /"[]" !"$comp_short; $comp_long" \) \|
|
/-/+ \( "$regex_short[@]" /"[]"/ \) \|
|
||||||
/"[]" !"$comp_opt" \) \#
|
/"[]"/ :"$comp_opt" \) \#
|
||||||
"$regex_all[@]"
|
"$regex_all[@]"
|
||||||
)
|
)
|
||||||
|
|
||||||
_regex_arguments "${funcname}_sm" "$regex_all[@]"
|
_regex_arguments "${funcname}_sm" "$regex_all[@]"
|
||||||
|
|
||||||
eval "$funcname () {
|
eval "$funcname () {
|
||||||
typeset -A canonicalize options
|
typeset -A canonicalize num_options
|
||||||
canonicalize=(${(kv)canonicalize})
|
canonicalize=(${(kv)canonicalize})
|
||||||
options=(${(kv)options})
|
num_options=(${(kv)num_options})
|
||||||
|
|
||||||
local short_hasarg short_bool short_intlevel short_configfile short_arbitem
|
local short_hasarg short_bool short_intlevel short_configfile short_arbitem
|
||||||
local long_hasarg long_bool long_intlevel long_configfile long_arbitem
|
local long_hasarg long_bool long_intlevel long_configfile long_arbitem
|
||||||
|
local bool_prefix
|
||||||
short_hasarg=($short_hasarg)
|
short_hasarg=($short_hasarg)
|
||||||
short_bool=($short_bool)
|
short_bool=($short_bool)
|
||||||
short_intlevel=($short_intlevel)
|
short_intlevel=($short_intlevel)
|
||||||
|
|
@ -331,13 +322,14 @@ compadd "$expl_opt[@]" -S= - $tmp2'
|
||||||
long_intlevel=($long_intlevel)
|
long_intlevel=($long_intlevel)
|
||||||
long_configfile=($long_configfile)
|
long_configfile=($long_configfile)
|
||||||
long_arbitem=($long_arbitem)
|
long_arbitem=($long_arbitem)
|
||||||
|
bool_prefix=($bool_prefix)
|
||||||
|
|
||||||
local expl_opt expl_bool expl_configfile
|
local expl_opt expl_bool expl_configfile
|
||||||
_description expl_opt option
|
_description options expl_opt option
|
||||||
_description expl_bool 'bool value'
|
_description values expl_bool 'boolean value'
|
||||||
_description expl_configfile 'config file'
|
_description files expl_configfile 'config file'
|
||||||
|
|
||||||
local current_option tmp1 tmp2
|
local current_option tmp1 tmp2 tmp3
|
||||||
|
|
||||||
${funcname}_sm
|
${funcname}_sm
|
||||||
}"
|
}"
|
||||||
|
|
@ -347,14 +339,16 @@ _apt_consume_short () {
|
||||||
local short opt
|
local short opt
|
||||||
for short in ${(s::)1}; do
|
for short in ${(s::)1}; do
|
||||||
opt="$canonicalize[-$short]"
|
opt="$canonicalize[-$short]"
|
||||||
(( 0 < options[$opt] && options[$opt]-- ))
|
(( 0 < num_options[$opt] && num_options[$opt]-- ))
|
||||||
done
|
done
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
_apt_consume_long () {
|
_apt_consume_long () {
|
||||||
local long opt
|
local long opt
|
||||||
opt="$canonicalize[--$1]"
|
opt="$canonicalize[--$1]"
|
||||||
(( 0 < options[$opt] && options[$opt]-- ))
|
(( 0 < num_options[$opt] && num_options[$opt]-- ))
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
_apt-get () {
|
_apt-get () {
|
||||||
|
|
@ -374,26 +368,28 @@ _apt-get () {
|
||||||
--no-upgrade:bool \
|
--no-upgrade:bool \
|
||||||
--force-yes:bool \
|
--force-yes:bool \
|
||||||
--print-uris:bool \
|
--print-uris:bool \
|
||||||
|
--purge:bool \
|
||||||
|
--list-cleanup:bool \
|
||||||
-c,--config-file:configfile \
|
-c,--config-file:configfile \
|
||||||
-o,--option:arbitem \
|
-o,--option:arbitem \
|
||||||
-- \
|
-- \
|
||||||
/$'update\0' \| \
|
/$'update\0'/ \| \
|
||||||
/$'upgrade\0' \| \
|
/$'upgrade\0'/ \| \
|
||||||
/$'install\0' /$'[^\0]#\0' !'_deb_packages uninstalled "$expl_packages[@]" || _deb_packages installed "$expl_packages[@]" ' \# \| \
|
/$'install\0'/ /$'[^\0]#\0'/ :'_deb_packages "$expl_packages[@]" uninstalled || _deb_packages "$expl_packages[@]" installed' \# \| \
|
||||||
/$'remove\0' /$'[^\0]#\0' !'_deb_packages installed "$expl_packages[@]"' \# \| \
|
/$'remove\0'/ /$'[^\0]#\0'/ :'_deb_packages "$expl_packages[@]" installed' \# \| \
|
||||||
/$'dist-upgrade\0' \| \
|
/$'dist-upgrade\0'/ \| \
|
||||||
/$'dselect-upgrade\0' \| \
|
/$'dselect-upgrade\0'/ \| \
|
||||||
/$'clean\0' \| \
|
/$'clean\0'/ \| \
|
||||||
/$'autoclean\0' \| \
|
/$'autoclean\0'/ \| \
|
||||||
/$'check\0' \| \
|
/$'check\0'/ \| \
|
||||||
/$'source\0' /$'[^\0]#\0' !'_deb_packages avail "$expl_packages[@]"' \# \| \
|
/$'source\0'/ /$'[^\0]#\0'/ :'_deb_packages "$expl_packages[@]" avail' \# \| \
|
||||||
/$'help\0' \| \
|
/$'help\0/' \| \
|
||||||
/"[]" !'compadd "$expl_action[@]" update upgrade install remove dist-upgrade dselect-upgrade clean autoclean check source help'
|
/"[]"/ :'_wanted actions expl_action action compadd update upgrade install remove dist-upgrade dselect-upgrade clean autoclean check source help'
|
||||||
|
|
||||||
_apt-get () {
|
_apt-get () {
|
||||||
local expl_action expl_packages
|
local expl_action expl_packages
|
||||||
_description expl_action 'action'
|
_description actions expl_action 'action'
|
||||||
_description expl_packages 'package'
|
_description packages expl_packages 'package'
|
||||||
|
|
||||||
_apt-get_sm
|
_apt-get_sm
|
||||||
}
|
}
|
||||||
|
|
@ -414,25 +410,26 @@ _apt-cache () {
|
||||||
-c,--config-file:configfile \
|
-c,--config-file:configfile \
|
||||||
-o,--option:arbitem \
|
-o,--option:arbitem \
|
||||||
-- \
|
-- \
|
||||||
/$'help\0' \| \
|
/$'help\0'/ \| \
|
||||||
/$'add\0' /$'[^\0]#\0' !'_files' \# \| \
|
/$'add\0'/ /$'[^\0]#\0'/ :'_files' \# \| \
|
||||||
/$'gencaches\0' \| \
|
/$'gencaches\0'/ \| \
|
||||||
/$'showpkg\0' /$'[^\0]#\0' !'_deb_packages avail "$expl_packages[@]"' \# \| \
|
/$'showpkg\0'/ /$'[^\0]#\0'/ :'_deb_packages "$expl_packages[@]" avail' \# \| \
|
||||||
/$'stats\0' \| \
|
/$'stats\0'=$status[4]/ \| \
|
||||||
/$'dump\0' \| \
|
/$'dump\0'/ \| \
|
||||||
/$'dumpavail\0' \| \
|
/$'dumpavail\0'/ \| \
|
||||||
/$'unmet\0' \| \
|
/$'unmet\0'/ \| \
|
||||||
/$'check\0' \| \
|
/$'check\0'/ \| \
|
||||||
/$'search\0' \| \
|
/$'search\0'/ /$'[^\0]#\0'/ :'_message "pattern"' \| \
|
||||||
/$'show\0' \| \
|
/$'show\0'/ /$'[^\0]#\0'/ :'_deb_packages "$expl_packages[@]" avail' \# \| \
|
||||||
/"[]" !'compadd "$expl_action[@]" help add gencaches showpkg stats dump dumpavail unmet check search show'
|
/$'depends\0'/ \| \
|
||||||
|
/"[]"/ :'_wanted actions expl_action action compadd help add gencaches showpkg stats dump dumpavail unmet check search show depends'
|
||||||
|
|
||||||
_apt-cache () {
|
_apt-cache () {
|
||||||
local expl_action expl_packages expl_pkg_cache expl_src_cache
|
local expl_action expl_packages expl_pkg_cache expl_src_cache
|
||||||
_description expl_action 'action'
|
_description actions expl_action 'action'
|
||||||
_description expl_packages 'package'
|
_description packages expl_packages 'package'
|
||||||
_description expl_pkg_cache 'package cache'
|
_description files expl_pkg_cache 'package cache'
|
||||||
_description expl_src_cache 'source cache'
|
_description files expl_src_cache 'source cache'
|
||||||
|
|
||||||
_apt-cache_sm
|
_apt-cache_sm
|
||||||
}
|
}
|
||||||
|
|
@ -453,13 +450,13 @@ _apt-cdrom () {
|
||||||
-c,--config-file:configfile \
|
-c,--config-file:configfile \
|
||||||
-o,--option:arbitem \
|
-o,--option:arbitem \
|
||||||
-- \
|
-- \
|
||||||
/$'add\0' \| \
|
/$'add\0'/ \| \
|
||||||
/"[]" !'compadd "$expl_action[@]" add'
|
/"[]"/ :'_wanted actions expl_action action compadd add'
|
||||||
|
|
||||||
_apt-cdrom () {
|
_apt-cdrom () {
|
||||||
local expl_action expl_mount_point
|
local expl_action expl_mount_point
|
||||||
_description expl_action 'action'
|
_description actions expl_action 'action'
|
||||||
_description expl_mount_point 'mount point'
|
_description files expl_mount_point 'mount point'
|
||||||
|
|
||||||
_apt-cdrom_sm
|
_apt-cdrom_sm
|
||||||
}
|
}
|
||||||
|
|
@ -474,19 +471,19 @@ _apt-config () {
|
||||||
-c,--config-file:configfile \
|
-c,--config-file:configfile \
|
||||||
-o,--option:arbitem \
|
-o,--option:arbitem \
|
||||||
-- \
|
-- \
|
||||||
/$'shell\0' \
|
/$'shell\0'/ \
|
||||||
\( \
|
\( \
|
||||||
/$'[^\0]#\0' !'compgen "$expl_shell_var[@]" -v' \
|
/$'[^\0]#\0'/ :'_wanted parameters expl_shell_var "shell variable to assign" compadd - "${(@k)parameters}"' \
|
||||||
/$'[^\0]#\0' !'compadd "$expl_config_key[@]" - ${${(f)"$(apt-config dump 2>&1)"}% *}' \
|
/$'[^\0]#\0'/ :'_wanted configuration-keys expl_config_key "configuration key" compadd - ${${(f)"$(apt-config dump 2>&1)"}% *}' \
|
||||||
\) \# \| \
|
\) \# \| \
|
||||||
/$'dump\0' \| \
|
/$'dump\0'/ \| \
|
||||||
/"[]" !'compadd "$expl_action[@]" shell dump'
|
/"[]"/ :'_wanted actions expl_action action compadd shell dump'
|
||||||
|
|
||||||
_apt-config () {
|
_apt-config () {
|
||||||
local expl_action expl_shell_var expl_config_key
|
local expl_action expl_shell_var expl_config_key
|
||||||
_description expl_action 'action'
|
_description actions expl_action 'action'
|
||||||
_description expl_shell_var 'shell variable to assign'
|
_description parameters expl_shell_var 'shell variable to assign'
|
||||||
_description expl_config_key 'configuration key'
|
_description configuration-keys expl_config_key 'configuration key'
|
||||||
|
|
||||||
_apt-config_sm
|
_apt-config_sm
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,62 @@
|
||||||
#compdef bug
|
#compdef bug reportbug
|
||||||
|
|
||||||
_arguments '-c[exclude configs from report]' \
|
_bug_commonargs=('-d[debug: send mail to postmaster@localhost]' \
|
||||||
'-d[debug - send mail to postmaster@localhost]' \
|
|
||||||
'-f[argument is a file, not a package]' \
|
|
||||||
'-H[special header]:custom header:' \
|
|
||||||
'-m[maintainer-only]' \
|
'-m[maintainer-only]' \
|
||||||
'-p[print to stdout instead of mail]' \
|
'-p[print to stdout instead of mail]' \
|
||||||
'-q[quiet - no e-mail forwarding]' \
|
'-q[quiet - no e-mail forwarding]' \
|
||||||
|
'-h[help]' \
|
||||||
|
'-v[version]' \
|
||||||
|
'*:package:_deb_packages installed')
|
||||||
|
|
||||||
|
case "${words[1]:t}" in
|
||||||
|
bug)
|
||||||
|
_arguments '-c[exclude configs from report]' \
|
||||||
|
'-f[argument is a file, not a package]' \
|
||||||
|
'-H[special header]:custom header:' \
|
||||||
'-s[set subject]:subject:' \
|
'-s[set subject]:subject:' \
|
||||||
'-S[set severity]:severity:(wishlist normal important grave critical)' \
|
'-S[set severity]:severity:(wishlist normal important grave critical)' \
|
||||||
'-x[do not cc submitter]' \
|
'-x[do not cc submitter]' \
|
||||||
'-z[send configs verbatim]' \
|
'-z[send configs verbatim]' \
|
||||||
'-h[help]' \
|
"$_bug_commonargs[@]"
|
||||||
'*:package:_deb_packages installed'
|
;;
|
||||||
|
|
||||||
|
reportbug)
|
||||||
|
_arguments '(--no-config-files)-c[exclude configs from report]' \
|
||||||
|
'(-c)--no-config-files' \
|
||||||
|
'(--file)-f[argument is a file, not a package]:filename:' \
|
||||||
|
'(-f)--file=:filename:' \
|
||||||
|
'(--header)-H[special header]:custom header:' \
|
||||||
|
'(-H)--header=:custom header:' \
|
||||||
|
'(--subject)-s[set subject]:subject:' \
|
||||||
|
'(-s)--subject=:subject:' \
|
||||||
|
'(--severity)-S[set severity]:severity:(wishlist normal important grave critical)' \
|
||||||
|
'(-S)--severity=:severity:(wishlist normal important grave critical)' \
|
||||||
|
'(--no-cc)-x[do not cc submitter]' \
|
||||||
|
'(-x)--no-cc' \
|
||||||
|
'(--no-compress)-z[send configs verbatim]' \
|
||||||
|
'(-z)--no-compress[send configs verbatim]' \
|
||||||
|
'(--af)-a[use af instead of editor]' \
|
||||||
|
'(-a)--af[use af instead of editor]' \
|
||||||
|
'(--no-bts-query)-b[do not check bts]' \
|
||||||
|
'(-b)--no-bts-query' \
|
||||||
|
'(--bts)-B[use alternate BTS]:system:(debian gnome kde tdyc)' \
|
||||||
|
'(-B)--bts=:system:(debian gnome kde tdyc)' \
|
||||||
|
'-g[sign report with GnuPG]' \
|
||||||
|
'(--include)-i[include text]:' \
|
||||||
|
'(-i)--include=:' \
|
||||||
|
'(--no-ldap)-l[disable LDAP support]' \
|
||||||
|
'(-l)--no-ldap' \
|
||||||
|
'(--mutt)-M[use mutt instead of editor]' \
|
||||||
|
'(-M)--mutt' \
|
||||||
|
'--mua=[use specified mua instead of editor]' \
|
||||||
|
'(--nmh --mh)-n[use comp instead of editor]' \
|
||||||
|
'(-n --mh)--nmh' \
|
||||||
|
'(--nmh -n)--mh' \
|
||||||
|
'(--output)-o[output to file instead of mail]' \
|
||||||
|
'(-o)--output=' \
|
||||||
|
'(--pgp)-P[sign report with PGP]' \
|
||||||
|
'(-P)--pgp' \
|
||||||
|
'--ldap[enable LDAP support]' \
|
||||||
|
"$_bug_commonargs[@]"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ _dpkg_common_args=('--help[show help]' \
|
||||||
'--version[show version]' \
|
'--version[show version]' \
|
||||||
'--licence[show licensing]')
|
'--licence[show licensing]')
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
dpkg)
|
dpkg)
|
||||||
_arguments -s '(--install)-i[install packages]:Debian package:_files -g \*.deb' \
|
_arguments -s '(--install)-i[install packages]:Debian package:_files -g \*.deb' \
|
||||||
'(-i)--install:Debian package:_files -g \*.deb' \
|
'(-i)--install:Debian package:_files -g \*.deb' \
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#compdef chown chgrp
|
#compdef chown chgrp
|
||||||
|
|
||||||
if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then
|
if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then
|
||||||
if [[ $words[1] = chgrp ]] || compset -P '*[:.]'; then
|
if [[ ${words[1]:t} = chgrp ]] || compset -P '*[:.]'; then
|
||||||
_groups
|
_groups
|
||||||
else
|
else
|
||||||
if [[ $OSTYPE = (solaris*|hpux*) ]]; then
|
if [[ $OSTYPE = (solaris*|hpux*) ]]; then
|
||||||
compgen -u -S ':' -q
|
_users -S ':' -q
|
||||||
else
|
else
|
||||||
compgen -u -S '.' -q
|
_users -S '.' -q
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,95 @@
|
||||||
#defcomp xdvi dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype
|
#compdef dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype
|
||||||
|
|
||||||
_files -g '*.(dvi|DVI)'
|
local expl args
|
||||||
|
|
||||||
|
args=(
|
||||||
|
'-i[specify input file]:input DVI file:_files -g \*.\(dvi\|DVI\)' \
|
||||||
|
'-o[specify output file]:output DVI file:_files -g \*.\(dvi\|DVI\)' \
|
||||||
|
':input DVI file:_files -g \*.\(dvi\|DVI\)' \
|
||||||
|
':output DVI file:_files -g \*.\(dvi\|DVI\)'
|
||||||
|
)
|
||||||
|
|
||||||
|
case "${words[1]:t}" in
|
||||||
|
dvips)
|
||||||
|
_arguments -s \
|
||||||
|
'-a[make three passes]' \
|
||||||
|
'(-B)-A[print only odd numbered pages]' \
|
||||||
|
'(-A)-B[print only even numbered pages]' \
|
||||||
|
'(-c -C)-b[select number of copies (duplicating body)]:number of copies:' \
|
||||||
|
'(-b -C)-c[select number of copies]:number of copies:' \
|
||||||
|
'(-b -c)-C[select number of copies (collated)]:number of copies:' \
|
||||||
|
'-d[set debug flags]:debug flags:' \
|
||||||
|
'(-X -Y)-D[set resolution]:resolution in dots per inch:' \
|
||||||
|
'-e[set maximum character offset]:maximum character offset:' \
|
||||||
|
'-E[generate EPSF file]' \
|
||||||
|
'(-o)-f[write to stdout]' \
|
||||||
|
'-F[append control-D]' \
|
||||||
|
'-h[specify additional header file]:postscript header file:_files -g \*.\(\#i\)\(ps\|eps\)' \
|
||||||
|
'-i[one file per section]' \
|
||||||
|
'-k[print crop marks]' \
|
||||||
|
'-K[include postscript comments]' \
|
||||||
|
'(-pp)-l[specify last page to print]:number of last page:' \
|
||||||
|
'-m[specify manual feed for printer]' \
|
||||||
|
'-M[no automatic font generation]' \
|
||||||
|
'(-pp)-n[specify maximum number of pages to print]:maximum number of pages:' \
|
||||||
|
'-N[turn off structured comments]' \
|
||||||
|
'(-f)-o[specify output file name]:output file name:_files -g \*.\(\#i\)\(ps\|eps\)' \
|
||||||
|
'-O[specify offset of origin]:offset of origin (<x>,<y>):' \
|
||||||
|
'(-p -l -n)-pp[specify which pages to print]:list of pages or ranges to print:' \
|
||||||
|
'(-pp)-p[specify first page to print]:number of first page:' \
|
||||||
|
'-P[specify printer]:printer name:' \
|
||||||
|
'-q[quiet operation]' \
|
||||||
|
'-r[reverse order of pages]' \
|
||||||
|
'-s[enclose output in save/restore pair]' \
|
||||||
|
'-S[set maximum number of pages per section]:maximum number of pages per section:' \
|
||||||
|
'(-T)*-t[specify paper type]:paper type:(letter legal ledger a4 a3 landscape)' \
|
||||||
|
'(-t)-T[set paper size]:paper size (<x>,<y>):' \
|
||||||
|
'-x[set magnification ratio]:magnification ratio (per mille):' \
|
||||||
|
'(-D)-X[set horizontal resolution]:horizontal resolution:' \
|
||||||
|
'(-D)-Y[set vertical resolution]:vertical resolution:' \
|
||||||
|
'-Z[compress bitmapped fonts]' \
|
||||||
|
':input file:_files -g \*.\(dvi\|DVI\)'
|
||||||
|
;;
|
||||||
|
dvibook)
|
||||||
|
_arguments -s \
|
||||||
|
'-q[quiet operation]' \
|
||||||
|
'-s-[specify signature size]:signature size:' \
|
||||||
|
"$args[@]"
|
||||||
|
;;
|
||||||
|
dviconcat)
|
||||||
|
_arguments \
|
||||||
|
'-m[specify magnification]:magnification factor:' \
|
||||||
|
'-o[specify output file]:output DVI file:_files -g \*.\(dvi\|DVI\)' \
|
||||||
|
'*:input DVI file:_files -g \*.\(dvi\|DVI\)'
|
||||||
|
;;
|
||||||
|
dvidvi)
|
||||||
|
_arguments -s \
|
||||||
|
'-q[quiet operation]' \
|
||||||
|
'-r[reverse order of pages]' \
|
||||||
|
'(-i -x)-f[select first page]:number of first page:' \
|
||||||
|
'(-i -x)-l[select last page]:number of last page:' \
|
||||||
|
'(-i -x)-n[select number of pages]:maximum number of pages:' \
|
||||||
|
'(-f -l -n)-i[specify included pages]:list of included pages:' \
|
||||||
|
'(-f -l -n)-x[specify excluded pages]:list of excluded pages:' \
|
||||||
|
':input DVI file:_files -g \*.\(dvi\|DVI\)' \
|
||||||
|
':output DVI file:_files -g \*.\(dvi\|DVI\)'
|
||||||
|
;;
|
||||||
|
dviselect)
|
||||||
|
_arguments -s \
|
||||||
|
'-s[silent operation]' \
|
||||||
|
':list of pages:' \
|
||||||
|
"$args[@]"
|
||||||
|
;;
|
||||||
|
dvitodvi)
|
||||||
|
_arguments -s \
|
||||||
|
'-q[quiet operation]' \
|
||||||
|
'-w-[set w dimension specifier]:width for dimension specifier:' \
|
||||||
|
'-h-[set h dimension specifier]:height for dimension specifier:' \
|
||||||
|
':page specifications:' \
|
||||||
|
"$args[@]"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_description files expl 'DVI file'
|
||||||
|
_files "$expl[@]" -g '*.(dvi|DVI)'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ if (( $# )); then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
display)
|
display)
|
||||||
_arguments -M 'm:{a-z}={A-Z}' \
|
_arguments -M 'm:{a-z}={A-Z}' \
|
||||||
'*-backdrop[use full screen]' \
|
'*-backdrop[use full screen]' \
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef ispell buildhash munchlist findaffix tryaffix icombine ijoin
|
#compdef ispell buildhash munchlist findaffix tryaffix icombine ijoin
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
ispell)
|
ispell)
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'(-n)-t[input file is in TeX/LaTeX format]' \
|
'(-n)-t[input file is in TeX/LaTeX format]' \
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ if compset -P -P || [[ "$words[CURRENT-1]" = -P ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ "$words[1]" = (lpq|lprm) ]]; then
|
if [[ "${words[1]:t}" = (lpq|lprm) ]]; then
|
||||||
if [[ "$words" = *-P* ]]; then
|
if [[ "$words" = *-P* ]]; then
|
||||||
printer=(-P "${${words##*-P( |)}%% *}")
|
printer=(-P "${${words##*-P( |)}%% *}")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@
|
||||||
# arguments for the `mount' command for different operating systems
|
# arguments for the `mount' command for different operating systems
|
||||||
# are below these table.
|
# are below these table.
|
||||||
|
|
||||||
local state line ret=1 args fss deffs=iso9660 descr tmp
|
local curcontext="$curcontext" state line ret=1
|
||||||
typeset -A options
|
local args fss deffs=iso9660 descr tmp typeops=-t _nfs_access _nfs_ufs
|
||||||
|
|
||||||
|
typeset -A opt_args
|
||||||
|
|
||||||
if (( ! $+_fs_any )); then
|
if (( ! $+_fs_any )); then
|
||||||
|
|
||||||
|
|
@ -14,8 +16,252 @@ if (( ! $+_fs_any )); then
|
||||||
# arguments for the `-o' option. There is one array per
|
# arguments for the `-o' option. There is one array per
|
||||||
# file system type (only for those that accept more values
|
# file system type (only for those that accept more values
|
||||||
# than those in the `_fs_any' array). The elements of the
|
# than those in the `_fs_any' array). The elements of the
|
||||||
# array are used as arguments to `_values'.
|
# array are used as arguments to `_values'. The first tables
|
||||||
|
# are used by several systems while system specific tables are
|
||||||
|
# (re)defined in a "$OSTYPE" case.
|
||||||
|
|
||||||
|
_fs_any=(
|
||||||
|
'(rw)ro[mount file system read-only]'
|
||||||
|
'(ro)rw[mount file system read-write]'
|
||||||
|
)
|
||||||
|
_nfs_access=(
|
||||||
|
'acregmin[specify cached file attributes minimum hold time]:cached file attributes minimum hold time:'
|
||||||
|
'acregmax[specify cached file attributes maximum hold time]:cached file attributes maximum hold time:'
|
||||||
|
'acdirmin[specify cached directory attributes minimum hold time]:cached directory attributes minimum hold time:'
|
||||||
|
'acdirmax[specify cached directory attributes maximum hold time]:cached directory attributes maximum hold time:'
|
||||||
|
'actimeo[set all attributes'"'"' cache timeout]:set all attributes'"'"' cache timeout:'
|
||||||
|
)
|
||||||
|
_fs_nfs=(
|
||||||
|
'rsize[specify read buffer size]:read buffer size:(8192)'
|
||||||
|
'wsize[specify write buffer size]:write buffer size:(8192)'
|
||||||
|
'(soft)hard[hang process on server crash (so to say)]'
|
||||||
|
'(hard)soft[allow time out on server crash]'
|
||||||
|
'(nolock)lock[use locking]'
|
||||||
|
'(lock)nolock[don'"'"'t use locking]'
|
||||||
|
'timeo[specify initial timeout for UDP]:initial timeout for UDP:'
|
||||||
|
'retrans[set number of NFS retransmissions]:number of NFS retransmissions:'
|
||||||
|
'retry[specify number of mount failure retries]:mount failure retries:'
|
||||||
|
'(fg)bg[retry in the background]'
|
||||||
|
'(bg)fg[retry in the foreground]'
|
||||||
|
'(nintr)intr[allow operations to be interrupted]'
|
||||||
|
'(intr)nintr[prevent operations from being interrupted]'
|
||||||
|
'(nfsv3)nfsv2[use NFS version 2]'
|
||||||
|
'(nfsv2)nfsv3[use NFS version 3]'
|
||||||
|
'proto[specify protocol]:protocol:(udp tcp)'
|
||||||
|
'port[specify server port number]:server port number:'
|
||||||
|
'proplist[allow property lists]'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
'nocto[don'"'"'t get fresh attributes on open]'
|
||||||
|
'noac[don'"'"'t set attribute caching]'
|
||||||
|
)
|
||||||
|
_nfs_ufs=(
|
||||||
|
'(nodev)dev[interpret devices]'
|
||||||
|
'(dev)nodev[don'"'"'t interpret devices]'
|
||||||
|
'(nosuid)suid[use suid and sgib bits]'
|
||||||
|
'(suid)nosuid[ignore suid and sgid bits]'
|
||||||
|
'(nosync)sync[do I/O synchronously]'
|
||||||
|
'(sync)nosync[do all I/O asynchronously]'
|
||||||
|
'(noexec)exec[permit execution of binaries]'
|
||||||
|
'(exec)noexec[don'"'"'t allow execution of binaries]'
|
||||||
|
'(nogrpid)grpid[new file gets group ID of directory]'
|
||||||
|
'(grpid)nogrpid[new file gets fsgid of current process]'
|
||||||
|
)
|
||||||
|
_fs_ufs=(
|
||||||
|
'dirty[allow mount even if not cleanly unmounted]'
|
||||||
|
"$_nfs_ufs[@]"
|
||||||
|
)
|
||||||
|
|
||||||
|
case "$OSTYPE" in
|
||||||
|
aix*)
|
||||||
|
_fs_any=(
|
||||||
|
'bsy[prevent mount over cwd of process]'
|
||||||
|
'log[logical volume to log operations]:logical volume name'
|
||||||
|
'nodev[cannot open devices from mount]'
|
||||||
|
'nosuid[prevent running setuid/setgid from mount]'
|
||||||
|
"$_fs_any[@]"
|
||||||
|
)
|
||||||
|
|
||||||
|
_fs_nfs=(
|
||||||
|
'(fg)bg[mount in background]'
|
||||||
|
'(bg)fg[mount in foreground]'
|
||||||
|
'vers[NFS version]:NFS version:(2 3)'
|
||||||
|
'proto[specify transport protocol]'
|
||||||
|
'retry[number of retries]:no. of retries'
|
||||||
|
'rsize[read buffer size]:read buffer size'
|
||||||
|
'wsize[write buffer size]:write buffer size'
|
||||||
|
'llock[local locking]'
|
||||||
|
'timeo[time-out period]:time-out period'
|
||||||
|
'retrans[NFS transmissions]:no. of NFS transmissions'
|
||||||
|
'port[IP port no]:IP port no'
|
||||||
|
'(hard)soft[error on no server response]'
|
||||||
|
'(soft)hard[retry pending server response]'
|
||||||
|
'(nointr)intr[allow keyboard interrupts on hard mount]'
|
||||||
|
'(intr)nointr[disallow keyboard interrupts on hard mount]'
|
||||||
|
'posix[exchange pathconf info on NFS version 2 mount]'
|
||||||
|
'secure[use DES encryption]'
|
||||||
|
'grpid[inherit group id of parent directory]'
|
||||||
|
'(acl)noacl[don'"'"'t use access control lists]'
|
||||||
|
'(noacl)acl[Use acces control lists for this mount]'
|
||||||
|
'noac[no attribute or directory caching]'
|
||||||
|
'shortdev[server lack support for 32-bit device special files]'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
irix*)
|
||||||
|
_fs_any=(
|
||||||
|
'nodev[cannot open devices from mount]'
|
||||||
|
'nosuid[prevent running setuid/setgid from mount]'
|
||||||
|
'grpid[inherit group id of parent directory]'
|
||||||
|
"$_fs_any[@]"
|
||||||
|
)
|
||||||
|
|
||||||
|
_fs_efs=(
|
||||||
|
'raw[raw device pathname to filesystem]:raw device pathname:->devordir'
|
||||||
|
'(nofsck)fsck[fsck should check this filesystem by default]'
|
||||||
|
'(fsck)nofsck[fsck should not check this filesystem by default]'
|
||||||
|
'(noquota)quota[turn on quotas]'
|
||||||
|
'(quota)noquota[turn off quotas]'
|
||||||
|
'lbsize[no of bytes transferred in each operation]:bytes'
|
||||||
|
)
|
||||||
|
|
||||||
|
_fs_iso9660=(
|
||||||
|
'setx[set execute permissions on every file]'
|
||||||
|
'notranslate[don'\''t translate filenames]'
|
||||||
|
'cache[no of 2048 blocks for directory cache]:cache size'
|
||||||
|
'noext[ignore rock ridge extensions]'
|
||||||
|
'(nosusp)susp[enable system use sharing protocol]'
|
||||||
|
'(susp)nosusp[disable system use sharing protocol]'
|
||||||
|
'(norrip)rrip[enable rock ridge extensions]'
|
||||||
|
'(rrip)norrip[disable rock ridge extensions]'
|
||||||
|
'nmconv[specify filename translation]:filename translation:(c l m)'
|
||||||
|
)
|
||||||
|
|
||||||
|
_fs_nfs=(
|
||||||
|
'(fg)bg[mount in background]'
|
||||||
|
'(bg)fg[mount in foreground]'
|
||||||
|
'retry[number of retries]:no. of retries'
|
||||||
|
'rsize[read buffer size]:read buffer size'
|
||||||
|
'wsize[write buffer size]:write buffer size'
|
||||||
|
'timeo[time-out period]:time-out period'
|
||||||
|
'retrans[NFS transmissions]:no. of NFS transmissions'
|
||||||
|
'port[IP port no]:IP port no'
|
||||||
|
'(hard)soft[error on no server response]'
|
||||||
|
'(soft)hard[retry pending server response]'
|
||||||
|
'intr[allow keyboard interrupts on hard mount]'
|
||||||
|
'noac[no attribute caching]'
|
||||||
|
'private[use local locking and do not flush on last close]'
|
||||||
|
'symttl[time-to-live of cached symbolic links]:seconds'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
)
|
||||||
|
|
||||||
|
_fs_cachefs=(
|
||||||
|
'backfstype[type of the back file system]:back file system type:(efs nfs iso9660 dos hfs cachefs)'
|
||||||
|
'backpath[specify back file system location]:back file system location:_files -/'
|
||||||
|
'cachedir[name of the cache directory]:name of cache directory:_files -/'
|
||||||
|
'cacheid[cache ID]:cache ID'
|
||||||
|
'(write-around)non-shared[cache not shared]'
|
||||||
|
'(non-shared)write-around[cache shared]'
|
||||||
|
'noconst[disable consistency checking]'
|
||||||
|
'local-access[check permissions locally]'
|
||||||
|
'purge[purge any cached information]'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
)
|
||||||
|
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
_fs_s5fs=(
|
||||||
|
'remount[remount file system]'
|
||||||
|
'(suid)nosuid[ignore suid and sgid bits]'
|
||||||
|
'(nosuid)suid[use suid and sgib bits]'
|
||||||
|
)
|
||||||
|
_fs_ufs=(
|
||||||
|
'(atime)noatime[don'"'"'t update access time]'
|
||||||
|
'f[fake an /etc/mnttab entry]'
|
||||||
|
'm[don'"'"'t make an /etc/mnttab entry]'
|
||||||
|
'(noforcedirectio)forcedirectio[do I/O synchronously]'
|
||||||
|
'(forcedirectio)noforcedirectio[do all I/O asynchronously]'
|
||||||
|
'(nointr)intr[allow operations to be interrupted]'
|
||||||
|
'(intr)nointr[prevent operations from being interrupted]'
|
||||||
|
'(nolargefiles)largefiles[don'"'"' restrict file size]'
|
||||||
|
'(largefiles)nolargefiles[restrict file size]'
|
||||||
|
'(nologging)logging[log transactions]'
|
||||||
|
'(logging)nologging[log transactions]'
|
||||||
|
'onerror[action to recover from error]:action(panic lock umout)'
|
||||||
|
'quota[turn on quotas]'
|
||||||
|
'(ro rw)rq[mount file system read-write with quotas]'
|
||||||
|
"$_fs_s5fs[@]"
|
||||||
|
)
|
||||||
|
_fs_tmpfs=(
|
||||||
|
'size[set file system size]:size:'
|
||||||
|
)
|
||||||
|
_fs_pcfs=(
|
||||||
|
'(nofoldcase)foldcase[force filenames to lowercase]'
|
||||||
|
'(foldcase)nofoldcase[don'"'"'t force filenames to lowercase]'
|
||||||
|
)
|
||||||
|
_fs_hsfs=(
|
||||||
|
'nrr[no rock ridge]'
|
||||||
|
'notraildot[no trail dot when no extension]'
|
||||||
|
'nomaplcase[don'"'"'t force lowercase]'
|
||||||
|
'nosiud[ignore suid and sgid bits]'
|
||||||
|
)
|
||||||
|
_fs_nfs=(
|
||||||
|
'(fg)bg[retry in the background]'
|
||||||
|
'(bg)fg[retry in the foreground]'
|
||||||
|
'(nogrpid)grpid[new file gets group ID of directory]'
|
||||||
|
'(grpid)nogrpid[new file gets fsgid of current process]'
|
||||||
|
'(nointr)intr[allow operations to be interrupted]'
|
||||||
|
'(intr)nointr[prevent operations from being interrupted]'
|
||||||
|
'(sec secure)kerberos[use kerberos authentication]'
|
||||||
|
'noac[no attribute caching]'
|
||||||
|
'port[server IP port number]:port:'
|
||||||
|
'posix[posix sematics]'
|
||||||
|
'proto[specify protocol]:protocol:'\("$(grep -v '^#' /etc/netconfig 2> /dev/null | cut -d ' ' -f 1)"\)
|
||||||
|
'public[force public file handle]'
|
||||||
|
'(noquota)quota[enable quotas]'
|
||||||
|
'(quota)noquota[disable quotas]'
|
||||||
|
'timeo[specify initial timeout for UDP]:initial timeout for UDP:'
|
||||||
|
'retrans[set number of NFS retransmissions]:number of NFS retransmissions:(5)'
|
||||||
|
'retry[specify number of mount failure retries]:mount failure retries:(10000)'
|
||||||
|
'rsize[specify read buffer size]:read buffer size:(8192)'
|
||||||
|
'wsize[specify write buffer size]:write buffer size:(8192)'
|
||||||
|
'(kerberos secure)sec[set the security mode]:security mode:(sys dh krb4 none)'
|
||||||
|
'(kerberos sec)secure[use Diffie-Hellman public key system]'
|
||||||
|
'vers[set NFS vesion number]:NFS version number:(2 3)'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
"$_fs_s5fs[@]"
|
||||||
|
)
|
||||||
|
_fs_cachefs=(
|
||||||
|
'backfstype[type of the back file system]:back file system type:(nfs hsfs)'
|
||||||
|
'backpath[specify back file system location]:back file system location:_files -/'
|
||||||
|
'cacheid[specify a cache ID]:cache ID:'
|
||||||
|
'local-access[check permissions locally]'
|
||||||
|
'noconst[disable cache consistency checking]'
|
||||||
|
'purge[purge any cached information]'
|
||||||
|
'(suid)nosuid[ignore setuid and setgid bits]'
|
||||||
|
'(nosuid)suid[use setuid and setgid bits]'
|
||||||
|
'(write-around)non-shared[purge cache on writes]'
|
||||||
|
'(non-shared)write-around[keep file in cache on writes]'
|
||||||
|
"$_nfs_access[@]"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
osf*)
|
||||||
|
_fs_advfs=(
|
||||||
|
'(ro rw)rq[mount file system read-write]'
|
||||||
|
'dual[allow mount even if same domain ID as already mounted domain]'
|
||||||
|
'sync[do I/O synchronously]'
|
||||||
|
)
|
||||||
|
_fs_cdfs=(
|
||||||
|
'(nodefperm)defperm[ignore permission bits]'
|
||||||
|
'(defperm)defperm[use permission bits]'
|
||||||
|
'noversion[strip off version extension]'
|
||||||
|
'rrip[use RRIP extensions]'
|
||||||
|
)
|
||||||
|
_fs_nfs=(
|
||||||
|
"$_nfs_ufs[@]"
|
||||||
|
"$_fs_nfs[@]"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
linux*)
|
||||||
_fs_any=(
|
_fs_any=(
|
||||||
'(sync)async[do all I/O asynchronously]'
|
'(sync)async[do all I/O asynchronously]'
|
||||||
'(noatime)atime[update access time]'
|
'(noatime)atime[update access time]'
|
||||||
|
|
@ -101,163 +347,230 @@ if (( ! $+_fs_any )); then
|
||||||
'block[specify block size]:block size:(512 1024 2048)'
|
'block[specify block size]:block size:(512 1024 2048)'
|
||||||
'cruft[ignore high bits of file length]'
|
'cruft[ignore high bits of file length]'
|
||||||
)
|
)
|
||||||
|
_fs_smbfs=( "$_fs_nfs[@]" )
|
||||||
# I fear that we have to make these system specific, too.
|
_fs_udf=(
|
||||||
|
'uid[specify user ID of all files]:user ID:'
|
||||||
_fs_nfs=(
|
'gid[specify group ID of all files]:group ID:'
|
||||||
'rsize[specify read buffer size]:read buffer size:(8192)'
|
'umask[specify umask]:umask value (octal):'
|
||||||
'wsize[specify write buffer size]:write buffer size:(8192)'
|
'unhide[show hidden and associated files]'
|
||||||
'(soft)hard[hang process on server crash (so to say)]'
|
'undelete[show deleted files]'
|
||||||
'(hard)soft[allow time out on server crash]'
|
'bs[set the block size]:block size:2048'
|
||||||
'(nolock)lock[use locking]'
|
'novrs[skip volume sequence recognition]'
|
||||||
'(lock)nolock[don'"'"'t use locking]'
|
'session[set the CDROM session]:session:'
|
||||||
'timeo[specify initial timeout for UDP]:initial timeout for UDP:'
|
'anchor[override standard anchor location]:anchor location:256'
|
||||||
'retrans[set number of NFS retransmissions]:number of NFS retransmissions:'
|
'lastblock[set the last block of the file system]:last block:'
|
||||||
'retry[specify number of mount failure retries]:mount failure retries:'
|
|
||||||
'(nobg)bg[retry in the background]'
|
|
||||||
'(nofg)fg[retry in the foreground]'
|
|
||||||
'(nointr)intr[allow operations to be interrupted]'
|
|
||||||
'(bg)nobg[don'"'"'t retry in the background]'
|
|
||||||
'(fg)nofg[don'"'"'t retry in the foreground]'
|
|
||||||
'(intr)nintr[prevent operations from being interrupted]'
|
|
||||||
'(nfsv3)nfsv2[use NFS version 2]'
|
|
||||||
'(nfsv2)nfsv3[use NFS version 3]'
|
|
||||||
'proto[specify protocol]:protocol:(udp tcp)'
|
|
||||||
'port[specify server port number]:server port number:' \
|
|
||||||
'proplist[allow property lists]'
|
|
||||||
'acregmin[specify cached file attributes minimum hold time]:cached file attributes minimum hold time:'
|
|
||||||
'acregmax[specify cached file attributes maximum hold time]:cached file attributes maximum hold time:'
|
|
||||||
'acdirmin[specify cached directory attributes minimum hold time]:cached directory attributes minimum hold time:'
|
|
||||||
'acdirmax[specify cached directory attributes maximum hold time]:cached directory attributes maximum hold time:'
|
|
||||||
'actimeo[set all attributes'"'"' cache timeout]:set all attributes'"'"' cache timeout:'
|
|
||||||
'nocto[don'"'"'t get fresh attributes on open]'
|
|
||||||
'noac[don'"'"'t set attribute caching]'
|
|
||||||
)
|
|
||||||
_fs_advfs=(
|
|
||||||
'(ro rw)rq[mount file system read-write]'
|
|
||||||
'dual[allow mount even if same domain ID as already mounted domain]'
|
|
||||||
)
|
)
|
||||||
_fs_ufs=(
|
_fs_ufs=(
|
||||||
'dirty[allow mount even if not cleanly unmounted]'
|
'ufstype[set ufs type]:ufs type:(old 44bsd sun sunx86 nextstep nextstep-cd openstep)'
|
||||||
"$_fs_nfs[@]"
|
'onerror[set behaviour on error]:behaviour on error:(panic lock umount repair)'
|
||||||
)
|
|
||||||
_fs_cdfs=(
|
|
||||||
'(nodefperm)defperm[ignore permission bits]'
|
|
||||||
'(defperm)defperm[use permission bits]'
|
|
||||||
'noversion[strip off version extension]'
|
|
||||||
'rrip[use RRIP extensions]'
|
|
||||||
)
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$words[1]" = mount ]]; then
|
if [[ "${words[1]:t}" = mount ]]; then
|
||||||
|
|
||||||
# Here are the tests and tables for the arguments and options for
|
# Here are the tests and tables for the arguments and options for
|
||||||
# the `mount' program. The `fss' array has to be set to the names
|
# the `mount' program. The `fss' array has to be set to the names
|
||||||
# of the file system types understood on this system.
|
# of the file system types understood on this system.
|
||||||
# This should also set the `deffs' parameter if the default file
|
# This should also set the `deffs' parameter if the default file
|
||||||
# system type is not `iso9660' (it should be set to the name of
|
# system type is not `iso9660' (it should be set to the name of
|
||||||
# the default file system type).
|
# the default file system type), and set 'typeops' to the mount
|
||||||
|
# option for file system type selection when it is not '-t'.
|
||||||
|
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
|
aix*)
|
||||||
|
args=( -s
|
||||||
|
'-a[mount all filesystems in /etc/fstab]'
|
||||||
|
'-f[forced mount]'
|
||||||
|
'-n[remote node]:remote node:_hosts'
|
||||||
|
'-p[mount as removable file system]'
|
||||||
|
'-r[mount read-only]'
|
||||||
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
|
'-o[specify file system options]:file system option:->fsopt'
|
||||||
|
'-v[filesystem defined by /etc/vfs]:VfsName'
|
||||||
|
':dev or dir:->devordir'
|
||||||
|
':mount point:_files -/'
|
||||||
|
)
|
||||||
|
fss=( jfs nfs cdrfs )
|
||||||
|
deffs=jfs
|
||||||
|
;;
|
||||||
|
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,'
|
||||||
|
'-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'
|
||||||
|
'-n[mount filesystem without making entry in /etc/mtab]'
|
||||||
|
'-o[specify file system options]:file system option:->fsopt'
|
||||||
|
'-p[print list of mounted filesystems in format suitable for /etc/fstab]'
|
||||||
|
'-r[mount read-only]'
|
||||||
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
|
'-v[verbose]'
|
||||||
|
'-M[use alternate mtab]:alternate mtab:_files'
|
||||||
|
'-P[with -p, prepend prefix to paths]:prefix'
|
||||||
|
)
|
||||||
|
fss=( efs proc fd nfs iso9660 dos hfs cachefs )
|
||||||
|
deffs=efs
|
||||||
|
;;
|
||||||
linux*)
|
linux*)
|
||||||
args=( -s
|
args=( -s
|
||||||
'-h[show help]' \
|
'-h[show help]'
|
||||||
'-V[show version]' \
|
'-V[show version]'
|
||||||
'-v[verbose mode]' \
|
'-v[verbose mode]'
|
||||||
'(-o)-a[mount all filesystems in fstab]' \
|
'(-o)-a[mount all filesystems in fstab]'
|
||||||
'-F[fork off one child per device]' \
|
'-F[fork off one child per device]'
|
||||||
'-f[fake mount]' \
|
'-f[fake mount]'
|
||||||
'-n[don'"'"'t write /etc/mtab]' \
|
'-n[don'"'"'t write /etc/mtab]'
|
||||||
'-s[tolerate sloppy mount options]' \
|
'-s[tolerate sloppy mount options]'
|
||||||
'-r[mount read-only]' \
|
'-r[mount read-only]'
|
||||||
'-w[mount read/write]' \
|
'-w[mount read/write]'
|
||||||
'-t[specify file system type]:file system type:->fstype' \
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
'-o[specify file system options]:file system option:->fsopt' \
|
'-o[specify file system options]:file system option:->fsopt'
|
||||||
':dev or dir:->devordir' \
|
':dev or dir:->devordir'
|
||||||
':mount point:_files -/'
|
':mount point:_files -/'
|
||||||
)
|
)
|
||||||
fss=( minix ext ext2 xiafs hpfs msdos umsdos vfat proc nfs iso9660
|
fss=( minix ext ext2 xiafs hpfs msdos umsdos vfat proc nfs iso9660
|
||||||
smbfs ncpfs affs ufs romfs sysv )
|
smbfs ncpfs affs ufs romfs sysv adfs autofs coda devpts efs
|
||||||
|
hfs ntfs qnx4 smbfs udf )
|
||||||
|
[[ -r /proc/filesystems ]] &&
|
||||||
|
fss=( ${$(</proc/filesystems)#nodev} )
|
||||||
;;
|
;;
|
||||||
osf*)
|
osf*)
|
||||||
args=( -s
|
args=( -s
|
||||||
'(-o)-a[mount all filesystems in fstab]' \
|
'(-o)-a[mount all filesystems in fstab]'
|
||||||
'-d[mount even if not unmounted]' \
|
'-d[mount even if not unmounted]'
|
||||||
'-e[list all mount points]' \
|
'-e[list all mount points]'
|
||||||
'-f[fake mount]' \
|
'-f[fake mount]'
|
||||||
'-l[display values of all file system options]' \
|
'-l[display values of all file system options]'
|
||||||
'-t[specify file system type]:file system type:->fstype' \
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
'-o[specify file system options]:file system option:->fsopt' \
|
'-o[specify file system options]:file system option:->fsopt'
|
||||||
'-u[remount file system]' \
|
'-u[remount file system]'
|
||||||
':dev or dir:->devordir' \
|
'-r[mount read-only]'
|
||||||
|
'-w[mount read/write]'
|
||||||
|
'-v[verbose]'
|
||||||
|
':dev or dir:->devordir'
|
||||||
':mount point:_files -/'
|
':mount point:_files -/'
|
||||||
|
)
|
||||||
fss=( advfs ufs nfs mfs cdfs )
|
fss=( advfs ufs nfs mfs cdfs )
|
||||||
|
deffs=cdfs
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
args=( -s
|
||||||
|
'(-p -v)-a[mount all filesystems in fstab]'
|
||||||
|
'(-p -v)-F[specify file system type]:file system type:->fstype'
|
||||||
|
'(-a -v)-p[print mounted file systems]'
|
||||||
|
'(-p -a)-v[print mounted file systems verbosely]'
|
||||||
|
'(-p -v)-V[fake mount]'
|
||||||
|
'(-p -v)-m[don'"'"'t write /etc/mnttab]'
|
||||||
|
'(-p -v)-g[mount globally]'
|
||||||
|
'(-p -v)-o[specify file system options]:file system option:->fsopt'
|
||||||
|
'(-p -v)-O[overlay mount]'
|
||||||
|
'(-p -v)-r[mount read-only]'
|
||||||
|
':dev or dir:->devordir'
|
||||||
|
':mount point:_files -/'
|
||||||
|
)
|
||||||
|
fss=( ufs nfs hsfs s5fs pcfs cachefs tmpfs )
|
||||||
|
deffs=hsfs
|
||||||
|
typeops=-F
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Default for all other systems. Dunno.
|
# Default for all other systems. Dunno.
|
||||||
|
|
||||||
args=( -s
|
args=( -s
|
||||||
'(-o)-a[mount all filesystems in fstab]' \
|
'(-o)-a[mount all filesystems in fstab]'
|
||||||
'-t[specify file system type]:file system type:->fstype' \
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
'-o[specify file system options]:file system option:->fsopt' \
|
'-o[specify file system options]:file system option:->fsopt'
|
||||||
'-f[fake mount]' \
|
'-f[fake mount]'
|
||||||
':dev or dir:->devordir' \
|
':dev or dir:->devordir'
|
||||||
':mount point:_files -/'
|
':mount point:_files -/'
|
||||||
|
)
|
||||||
fss=( ufs )
|
fss=( ufs )
|
||||||
|
deffs=ufs
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
_arguments "$args[@]" && ret=0
|
_arguments -C "$args[@]" && ret=0
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# Completion for umount.
|
# Completion for umount.
|
||||||
|
|
||||||
_arguments -s \
|
case "$OSTYPE" in
|
||||||
'-h[show help]' \
|
aix*)
|
||||||
'-V[show version]' \
|
args=(
|
||||||
'-v[verbose mode]' \
|
'-a[unmount all mounted file systems]'
|
||||||
'-n[don'"'"'t write /etc/mtab]' \
|
'-f[force unmount]'
|
||||||
'-r[remount read-only on failure]' \
|
'-n[remote node]:remote node:_hosts'
|
||||||
'-a[unmount all file systems from /etc/mtab]' \
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
'-t[specify file system type]:file system type:->fstype' \
|
'*:dev or dir:->udevordir'
|
||||||
'*:dev or dir:->udevordir' && ret=0
|
)
|
||||||
|
;;
|
||||||
|
irix*)
|
||||||
|
args=(
|
||||||
|
'-a[unmount all mounted file systems]'
|
||||||
|
'-b[unmount all filesystems in /etc/fstab except those listed]:list of directories:_files -/ -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'
|
||||||
|
'-v[verbose]'
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
args=( \
|
||||||
|
'-h[show help]'
|
||||||
|
'-V[show version]'
|
||||||
|
'-v[verbose mode]'
|
||||||
|
'-n[don'"'"'t write /etc/mtab]'
|
||||||
|
'-r[remount read-only on failure]'
|
||||||
|
'-a[unmount all file systems from /etc/mtab]'
|
||||||
|
'-t[specify file system type]:file system type:->fstype'
|
||||||
|
'*:dev or dir:->udevordir'
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
_arguments -C -s "$args[@]" && ret=0
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
fstype)
|
fstype)
|
||||||
compset -P '*,'
|
compset -P '*,'
|
||||||
_description expl 'file system type'
|
|
||||||
compadd "$expl[@]" -qS, -M 'L:no=' - "$fss[@]" && ret=0
|
_wanted types expl 'file system type' \
|
||||||
|
compadd "$expl[@]" -qS, -M 'L:|no=' - "$fss[@]" && ret=0
|
||||||
;;
|
;;
|
||||||
fsopt)
|
fsopt)
|
||||||
eval 'tmp=(' '"$_fs_'${(s:,:)^${options[-t]:-${deffs}}}'[@]"' ')'
|
_wanted options || return 1
|
||||||
|
|
||||||
|
eval 'tmp=(' '"$_fs_'${(s:,:)^${opt_args[$typeops]:-${deffs}}}'[@]"' ')'
|
||||||
tmp=( "$_fs_any[@]" "${(@)tmp:#}" )
|
tmp=( "$_fs_any[@]" "${(@)tmp:#}" )
|
||||||
_values -s , 'file system options' "$tmp[@]" && ret=0
|
_values -s , 'file system options' "$tmp[@]" && ret=0
|
||||||
;;
|
;;
|
||||||
devordir)
|
devordir)
|
||||||
if (( $+options[-a] )); then
|
if (( $+opt_args[-a] )); then
|
||||||
_message "no device or directory with option \`-a'"
|
_message "no device or directory with option \`-a'"
|
||||||
else
|
else
|
||||||
_description expl device
|
_alternative \
|
||||||
compadd "$expl[@]" /dev/* && ret=0
|
'devices:device:compadd /dev/\*' \
|
||||||
if (( ! $+options[-t] )); then
|
'directories:mount point:_files -/' && ret=0
|
||||||
_description expl 'mount point'
|
|
||||||
_files "$expl[@]" -/ && ret=0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
udevordir)
|
udevordir)
|
||||||
if (( $+options[-a] )); then
|
if (( $+opt_args[-a] )); then
|
||||||
_message "no device or directory with option \`-a'"
|
_message "no device or directory with option \`-a'"
|
||||||
else
|
else
|
||||||
|
local dev_tmp mp_tmp
|
||||||
|
|
||||||
tmp=( "${(@f)$(< /etc/mtab)}" )
|
tmp=( "${(@f)$(< /etc/mtab)}" )
|
||||||
_description expl device
|
dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
|
||||||
compadd "$expl[@]" - "${(@)${(@)tmp%% *}:#none}" && ret=0
|
mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
|
||||||
if (( ! $+options[-t] )); then
|
|
||||||
_description expl 'mount point'
|
_alternative \
|
||||||
compadd "$expl[@]" - "${(@)${(@)tmp#* }%% *}"
|
'devices:device:compadd - $dev_tmp[@]' \
|
||||||
fi
|
'directories:mount point:compadd - $mp_tmp[@]' && ret=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -24,33 +24,33 @@ _mysql_hosts () {
|
||||||
local _mysql_user _mysql_port _mysql_host _mysql_params
|
local _mysql_user _mysql_port _mysql_host _mysql_params
|
||||||
_mysql_get_identity
|
_mysql_get_identity
|
||||||
|
|
||||||
_wanted hosts expl 'server host' &&
|
_wanted hosts expl 'server host' \
|
||||||
_combination -s '[:@]' '' hosts-ports-users \
|
_combination -s '[:@]' '' hosts-ports-users \
|
||||||
${_mysql_user:+users=${_mysql_user:q}} \
|
${_mysql_user:+users=${_mysql_user:q}} \
|
||||||
${_mysql_port:+ports=${_mysql_port:q}} \
|
${_mysql_port:+ports=${_mysql_port:q}} \
|
||||||
hosts "$expl[@]"
|
hosts -
|
||||||
}
|
}
|
||||||
|
|
||||||
_mysql_ports () {
|
_mysql_ports () {
|
||||||
local _mysql_user _mysql_port _mysql_host _mysql_params
|
local _mysql_user _mysql_port _mysql_host _mysql_params
|
||||||
_mysql_get_identity
|
_mysql_get_identity
|
||||||
|
|
||||||
_wanted ports expl 'server port' &&
|
_wanted ports expl 'server port' \
|
||||||
_combination -s '[:@]' '' hosts-ports-users \
|
_combination -s '[:@]' '' hosts-ports-users \
|
||||||
${_mysql_user:+users=${_mysql_user:q}} \
|
${_mysql_user:+users=${_mysql_user:q}} \
|
||||||
${_mysql_host:+hosts=${_mysql_host:q}} \
|
${_mysql_host:+hosts=${_mysql_host:q}} \
|
||||||
ports "$expl[@]"
|
ports -
|
||||||
}
|
}
|
||||||
|
|
||||||
_mysql_users () {
|
_mysql_users () {
|
||||||
local _mysql_user _mysql_port _mysql_host _mysql_params
|
local _mysql_user _mysql_port _mysql_host _mysql_params
|
||||||
_mysql_get_identity
|
_mysql_get_identity
|
||||||
|
|
||||||
_wanted users expl 'server username' &&
|
_wanted users expl 'server username' \
|
||||||
_combination -s '[:@]' '' hosts-ports-users \
|
_combination -s '[:@]' '' hosts-ports-users \
|
||||||
${_mysql_host:+hosts=${_mysql_host:q}} \
|
${_mysql_host:+hosts=${_mysql_host:q}} \
|
||||||
${_mysql_port:+ports=${_mysql_port:q}} \
|
${_mysql_port:+ports=${_mysql_port:q}} \
|
||||||
users "$expl[@]"
|
users -
|
||||||
}
|
}
|
||||||
|
|
||||||
_mysql_databases () {
|
_mysql_databases () {
|
||||||
|
|
@ -205,15 +205,13 @@ _mysqladmin_commands () {
|
||||||
)
|
)
|
||||||
|
|
||||||
if (( CURRENT == 1 )); then
|
if (( CURRENT == 1 )); then
|
||||||
_tags commands && compadd "$@" $cmds
|
_wanted commands expl command compadd "$@" - $cmds
|
||||||
else
|
else
|
||||||
local curcontext="$curcontext"
|
local curcontext="$curcontext"
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
(create)
|
(create|drop)
|
||||||
;&
|
_wanted mysqldbs expl "MySQL databases" _mysql_databases
|
||||||
(drop)
|
|
||||||
_wanted mysqldbs expl "MySQL databases" && _mysql_databases
|
|
||||||
;;
|
;;
|
||||||
(kill)
|
(kill)
|
||||||
_message 'thread ids'
|
_message 'thread ids'
|
||||||
|
|
@ -226,7 +224,7 @@ _mysqladmin_commands () {
|
||||||
}
|
}
|
||||||
|
|
||||||
_mysql_utils () {
|
_mysql_utils () {
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
mysql)
|
mysql)
|
||||||
_mysql "$@"
|
_mysql "$@"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1,63 +1,90 @@
|
||||||
#compdef -P (p[bgpn]m*|*top[bgpn]m)
|
#compdef -P (p[bgpn]m*|*top[bgpn]m)
|
||||||
|
|
||||||
local pat expl ret=1
|
# Completion for all (or most, you'll never know) pbmplus commands.
|
||||||
|
# For some of them there are special cases in the biggish `case' below.
|
||||||
|
# Note that since this function is a post-pattern function, these
|
||||||
|
# defaults can be overridden by simply defining completion functions
|
||||||
|
# for those commands whose arguments you want to complete differently.
|
||||||
|
|
||||||
if [[ "$words[1]" = pnm* ]]; then
|
local pat expl ret=1 cmd="${words[1]:t}"
|
||||||
|
|
||||||
|
if [[ "$cmd" = pnm* ]]; then
|
||||||
pat='*.(#i)p[bgp]m'
|
pat='*.(#i)p[bgp]m'
|
||||||
elif [[ "$words[1]" = *top[bgpn]m ]]; then
|
elif [[ "$cmd" = *top[bgpn]m ]]; then
|
||||||
pat="*.(#i)${words[1]%%top[bgpn]m}"
|
pat="*.(#i)${cmd%%top[bgpn]m}"
|
||||||
else
|
else
|
||||||
pat="*.(#i)${words[1][1,3]}"
|
pat="*.(#i)${cmd[1,3]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
|
if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
|
||||||
if (( ! $# )); then
|
_wanted files expl 'picture file' _path_files "$@" -g "$pat" - ||
|
||||||
_description expl 'picture file'
|
_files "$@" "$expl[@]" -g '*.(#i)p[bgp]m'
|
||||||
set -- "$expl[@]"
|
|
||||||
fi
|
|
||||||
_path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m'
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local _in_pbm=yes
|
local _in_pbm=yes
|
||||||
|
|
||||||
case "$words[1]" in
|
case "$cmd" in
|
||||||
asciitopnm)
|
asciitop[gn]m)
|
||||||
_arguments '-d:divisor:' ':height:' ':width:' ':file: _pbm'
|
_arguments \
|
||||||
|
'-d[specify divisor]:divisor:' \
|
||||||
|
':height:' ':width:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
fitstopgm)
|
fitstopgm)
|
||||||
_arguments '-image:image number:' ':file: _pbm'
|
_arguments \
|
||||||
;;
|
'-image[specify image number]:image number:' \
|
||||||
|
|
||||||
fitstopnm)
|
|
||||||
_arguments -{noraw,scanmax,printmax} '-image:image number:' \
|
|
||||||
'-min:minimum value:' '-max:maximum value:' ':file: _pbm'
|
|
||||||
;;
|
|
||||||
|
|
||||||
g3topbm)
|
|
||||||
_arguments -{kludge,reversebits,stretch} ':file: _pbm'
|
|
||||||
;;
|
|
||||||
|
|
||||||
giftopnm)
|
|
||||||
_arguments -{verbose,comments} '-image:image number:' \
|
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
fitstopnm)
|
||||||
|
_arguments \
|
||||||
|
'-image[specify image number]:image number:' \
|
||||||
|
'-noraw[produce ASCII pnm file]' \
|
||||||
|
'(-min -max)-scanmax[force scanning data for minimum and maximum]' \
|
||||||
|
'-printmax[only print minimum and maximum values]' \
|
||||||
|
'(-scanmax)-min[override minimum value]:minimum value:' \
|
||||||
|
'(-scanmax)-max[override maximum value]:maximum value:' \
|
||||||
|
':file: _pbm'
|
||||||
|
;;
|
||||||
|
|
||||||
|
g3topbm)
|
||||||
|
_arguments \
|
||||||
|
'-kludge[ignore first few lines]' \
|
||||||
|
'-reversebits[interpret bits least-significant first]' \
|
||||||
|
'-stretch[duplicate each row]' \
|
||||||
|
':file: _pbm'
|
||||||
|
;;
|
||||||
|
|
||||||
|
giftopnm)
|
||||||
|
_arguments \
|
||||||
|
'-verbose[verbose mode]' \
|
||||||
|
'-comments[only print comment fields]' \
|
||||||
|
'-image[specify image number]:image number:' \
|
||||||
|
':file: _pbm'
|
||||||
|
;;
|
||||||
macptopbm)
|
macptopbm)
|
||||||
_arguments '-extraskip:number of bytes to skip:' ':file: _pbm'
|
_arguments '-extraskip:number of bytes to skip:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmclean)
|
pbmclean)
|
||||||
_arguments '-connect' ':file: _pbm'
|
if [[ "$PREFIX" = -* ]]; then
|
||||||
|
_message 'maximum number of identical neighbours'
|
||||||
|
else
|
||||||
|
_pbm
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmmake)
|
pbmmake)
|
||||||
_arguments -{white,black,gray} ':width:' ':height:'
|
_arguments \
|
||||||
|
'(-black -gray)-white[produce white pbm file]' \
|
||||||
|
'(-white -gray)-black[produce black pbm file]' \
|
||||||
|
'(-white -black)-gray[produce gray pbm file (stippled)]' \
|
||||||
|
':width:' ':height:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmmask)
|
pbmmask)
|
||||||
_arguments '-expand' ':file: _pbm'
|
_arguments '-expand[expand mask by one pixel]' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmpscale)
|
pbmpscale)
|
||||||
|
|
@ -65,16 +92,23 @@ pbmpscale)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmreduce)
|
pbmreduce)
|
||||||
_arguments -{floyd,fs,threshold} '-value:threshold value:' \
|
_arguments \
|
||||||
|
'(-fs -threshold)-floyd[use Floyd-Steinberg error diffusion]' \
|
||||||
|
'(-floyd -threshold)-fs[use Floyd-Steinberg error diffusion]' \
|
||||||
|
'(-floy -fs)-threshold[use simple thresholding]' \
|
||||||
|
'-value[specify thresholding value]:threshold value:' \
|
||||||
':reduction factor:' ':file: _pbm'
|
':reduction factor:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtext)
|
pbmtext)
|
||||||
_arguments '-font:font file:_files -g \*.\(\#i\)pbm' '*:text:'
|
_arguments \
|
||||||
|
'(-builtin)-font[specify font file]:font file:_files -g \*.\(\#i\)pbm' \
|
||||||
|
'(-font)-builtin[select builtin font]:builtin font:(bdf fixed)' \
|
||||||
|
'*:text:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmto10x)
|
pbmto10x)
|
||||||
_arguments '-h' ':file: _pbm'
|
_arguments '-h[use resolution 120 x 144]' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtobg|pbmtobbnbg)
|
pbmtobg|pbmtobbnbg)
|
||||||
|
|
@ -82,24 +116,37 @@ pbmtobg|pbmtobbnbg)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtoepsi)
|
pbmtoepsi)
|
||||||
_arguments '-bbonly' ':file: _pbm'
|
_arguments '-bbonly[only create boundary box]' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtolj)
|
pbmtolj)
|
||||||
_arguments '-resolution:resolution:(75 100 150 300)' ':file: _pbm'
|
_arguments \
|
||||||
|
'-float[suppress positioning information]' \
|
||||||
|
'-norest[don'"'"'t write reset sequences]' \
|
||||||
|
'-resolution[specify output device resolution]:resolution:(75 100 150 300)' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtoln03)
|
pbmtoln03)
|
||||||
_arguments -{l:left,r:right,t:top,b:bottom}' margin:' \
|
_arguments \
|
||||||
'-f:form length:' ':file: _pbm'
|
'-l[specify left margin]:left margin:' \
|
||||||
|
'-r[specify right margin]:right margin:' \
|
||||||
|
'-t[specify top margin]:top margin:' \
|
||||||
|
'-b[specify bottom margin]:bottom margin:' \
|
||||||
|
'-f[specify form length]:form length:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtolps)
|
pbmtolps)
|
||||||
_arguments '-dpi:resolution:' ':file: _pbm'
|
_arguments '-dpi[specify output resolution]:resolution:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtomacp)
|
pbmtomacp)
|
||||||
_arguments -{l:left,r:right,t:top,b:bottom}' offset:' ':file: _pbm'
|
_arguments \
|
||||||
|
'-l[specify left offset]:left offset:' \
|
||||||
|
'-r[specify right offset]:right offset:' \
|
||||||
|
'-t[specify top offset]:top offset:' \
|
||||||
|
'-b[specify bottom offset]:bottom offset:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pbmtopgm)
|
pbmtopgm)
|
||||||
|
|
@ -109,12 +156,22 @@ pbmtopgm)
|
||||||
pbmtopk)
|
pbmtopk)
|
||||||
# This could be improved...
|
# This could be improved...
|
||||||
|
|
||||||
_arguments '-s:design size:' '-C:coding scheme:' '-F:font family:' \
|
_arguments \
|
||||||
'-f:option file:_files' '-c:character number:' \
|
'-s[set design size]:design size:' \
|
||||||
'-W:width:' '-H:height:' '-D:depth:' '-I:italic correction:' \
|
'-C[set coding scheme]:coding scheme:' \
|
||||||
'-h:horizontal escapement:' '-v:vertical escapement:' \
|
'-F[set font family comment]:font family:' \
|
||||||
'-x:x offset:' '-y:y offset:' \
|
'-f[specify file with options]:option file:_files' \
|
||||||
':pk file:_files -g \*.\(\#i\)pk' ':tfm file:_files -g \*.\(\#i\)tfm' \
|
'*-c[specify next character number]:character number:' \
|
||||||
|
'*-W[specify TFM width of next character]:width:' \
|
||||||
|
'*-H[specify TFM height of next character]:height:' \
|
||||||
|
'*-D[specify TFM depth of next character]:depth:' \
|
||||||
|
'*-I[specify italic correction of next character]:italic correction:' \
|
||||||
|
'*-h[specify horizontal escapement of next character]:horizontal escapement:' \
|
||||||
|
'*-v[specify vertical escapement of next character]:vertical escapement:' \
|
||||||
|
'*-x[specify x offset of next character]:x offset:' \
|
||||||
|
'*-y[specify y offset of next character]:y offset:' \
|
||||||
|
':pk file:_files -g \*.\(\#i\)pk' \
|
||||||
|
':tfm file:_files -g \*.\(\#i\)tfm' \
|
||||||
'*:file: _pbm'
|
'*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -124,8 +181,13 @@ pbmupc)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmcrater)
|
pgmcrater)
|
||||||
_arguments '-number:number of craters:' '-gamma:factor:' \
|
_arguments \
|
||||||
-{height,ysize}:height: -{width,xsize}:width:
|
'-number[specify number of craters]:number of craters:' \
|
||||||
|
'-gamma[specify gamma correction factor]:gamma factor:' \
|
||||||
|
'(-ysize)-height[specify picture height]:height:' \
|
||||||
|
'(-height)-ysize[specify picture height]:height:' \
|
||||||
|
'(-xsize)-width[specify picture width]:width:' \
|
||||||
|
'(-width)-xsize[specify picture width]:width:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmkernel)
|
pgmkernel)
|
||||||
|
|
@ -137,26 +199,48 @@ pgmnoise)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmnorm|ppmnorm)
|
pgmnorm|ppmnorm)
|
||||||
_arguments '-bpercent:black percentage:' '-bvalue:black pixel value:' \
|
_arguments \
|
||||||
'-wpercent:white percentage:' '-wvalue:white pixel value:' \
|
'(-bvalue)-bpercent[specify percentage to map to black]:black percentage:' \
|
||||||
|
'(-bpercent)-bvalue[specify pixel value to map to black]:black pixel value:' \
|
||||||
|
'(-wvalue)-wpercent[specify percentage to map to white]:white percentage:' \
|
||||||
|
'(-wpercent)-wvalue[specify pixel value to map to white]:white pixel value:' \
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmoil)
|
pgmoil)
|
||||||
_arguments '-n:smear size:' ':file: _pbm'
|
_arguments '-n[specify smear size]:smear size:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmramp)
|
pgmramp)
|
||||||
_arguments -{lr,tb,rectangle,ellipse} ':width:' ':height:'
|
_arguments \
|
||||||
|
'(-tb -rectangle -ellipse)-lr[produce left to right ramp]' \
|
||||||
|
'(-lr -rectangle -ellipse)-tb[produce top to bottom ramp]' \
|
||||||
|
'(-lr -tb -ellipse)-rectangle[produce rectangular ramp]' \
|
||||||
|
'(-lr -tb -rectangle)-ellipse[produce elliptical ramp]' \
|
||||||
|
':width:' ':height:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmtexture)
|
pgmtexture)
|
||||||
_arguments '-d:distance:' ':file: _pbm'
|
_arguments '-d[specify distance]:distance:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmtopbm)
|
pgmtopbm)
|
||||||
_arguments -{floyd,fs,threshold,dither8,d8,cluster3,c3,cluster4,c4,cluster8,c8} \
|
_arguments \
|
||||||
'-value:threshold value:' ':file: _pbm'
|
'(-fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-floyd[use FLoyd-Steinberg error diffusion]' \
|
||||||
|
'(-floyd -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-fs[use FLoyd-Steinberg error diffusion]' \
|
||||||
|
'(-floyd -fs -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-threshold[use simple thresholding]' \
|
||||||
|
'(-floyd -fs -threshold -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value)-hilbert[use space filling curve halftoning (hilbert curve)]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-dither8[use Bayer'"'"'s ordered dither (16 x 16 matrix)]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-d8[use Bayer'"'"'s ordered dither (16 x 16 matrix)]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-cluster3[use 45 degree clustered dither]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -cluster4 -c4 -cluster8 -c8 -value -clump)-c3[use 45 degree clustered dither]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -c4 -cluster8 -c8 -value -clump)-cluster4[use 45 degree clustered dither]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -cluster8 -c8 -value -clump)-c4[use 45 degree clustered dither]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -c8 -value -clump)-cluster8[use 45 degree clustered dither]' \
|
||||||
|
'(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -value -clump)-c8[use 45 degree clustered dither]' \
|
||||||
|
'-value[specify thresholding value]:threshold value:' \
|
||||||
|
'-clump[specify number of pixels per clump]:number of pixel:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pgmtoppm)
|
pgmtoppm)
|
||||||
|
|
@ -167,12 +251,11 @@ pgmtoppm)
|
||||||
fi
|
fi
|
||||||
_x_color && ret=0
|
_x_color && ret=0
|
||||||
|
|
||||||
_description expl option
|
_wanted options expl option compadd - -map && ret=0
|
||||||
compadd "$expl[@]" - -map && ret=0
|
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
|
elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
|
||||||
_description expl 'map file'
|
_description files expl 'map file'
|
||||||
_files "$expl[@]" -g '*.(#i)ppm'
|
_files "$expl[@]" -g '*.(#i)ppm'
|
||||||
else
|
else
|
||||||
_pbm
|
_pbm
|
||||||
|
|
@ -180,29 +263,53 @@ pgmtoppm)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pktopbm)
|
pktopbm)
|
||||||
_arguments ':pk file:_files -g \*.\(\#i\)pk' '-c:character number:' \
|
_arguments \
|
||||||
|
'*-x[set width of next bitmap]:width:' \
|
||||||
|
'*-y[set height of next bitmap]:height:' \
|
||||||
|
'*-c[set next character number]:character number:' \
|
||||||
|
':pk file:_files -g \*.\(\#i\)pk' \
|
||||||
'*:file: _pbm'
|
'*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmalias)
|
pnmalias)
|
||||||
_arguments '-bgcolor:background color:_x_color' \
|
_arguments \
|
||||||
'-fgcolor:foreground color:_x_color' \
|
'-bgcolor[specify background color]:background color:_x_color' \
|
||||||
-{f,b}only -{f,b}alias \
|
'-fgcolor[specify background color]:foreground color:_x_color' \
|
||||||
'-weight:central aliasing weight:' ':file: _pbm'
|
'(-bonly)-fonly[apply antialias only to foreground pixels]' \
|
||||||
|
'(-fonly)-bonly[apply antialias only to background pixels]' \
|
||||||
|
'(-balias)-falias[apply antialias to all pixels around foreground pixels]' \
|
||||||
|
'(-falias)-balias[apply antialias to all pixels around foreground pixels]' \
|
||||||
|
'-weight[set central aliasing weight]:central aliasing weight:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmarith)
|
pnmarith)
|
||||||
_arguments -{add,subtract,multiply} '*:file: _pbm'
|
_arguments \
|
||||||
|
-{add,subtract,multiply,difference,minimum,maximum} \
|
||||||
|
'*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmcat)
|
pnmcat)
|
||||||
_arguments -{white,black,leftright,lr,topbottom,tb,jtop,jbottom,jleft,jright} \
|
_arguments \
|
||||||
|
'(-black)-white[]' \
|
||||||
|
'(-white)-black[]' \
|
||||||
|
'(-lr -topbottom -tb -jleft -jright)-leftright[place pictures left to right]' \
|
||||||
|
'(-leftright -topbottom -tb -jleft -jright)-lr[place pictures left to right]' \
|
||||||
|
'(-tb -leftright -lr -jtop -jbottom)-topbottom[place pictures top to bottom]' \
|
||||||
|
'(-topbottom -leftright -lr -jtop -jbottom)-tb[place pictures top to bottom]' \
|
||||||
|
'(-topbottom -tb -jbottom -jleft -jright)-jtop[align pictures at top]' \
|
||||||
|
'(-topbottom -tb -jtop -jleft -jright)-jbottom[align pictures at bottom]' \
|
||||||
|
'(-leftright -lr -jright -jtop -jbottom)-jleft[align pictures at left side]' \
|
||||||
|
'(-leftright -lr -jleft -jtop -jbottom)-jright[align pictures at right side]' \
|
||||||
'*:file: _pbm'
|
'*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmcomp)
|
pnmcomp)
|
||||||
_arguments '-invert' '-xoff:x offset:' '-yoff:y offset:' \
|
_arguments \
|
||||||
'-alpha:alpha mask file:_files -g \*.\(\#i\)pgm' \
|
'-invert[invert overlay pixel values]' \
|
||||||
|
'-xoff[specify overlay x offset]:x offset:' \
|
||||||
|
'-yoff[specify overlay y offset]:y offset:' \
|
||||||
|
'-alpha[specify alpha mask file]:alpha mask file:_files -g \*.\(\#i\)pgm' \
|
||||||
':overlay file:_pbm' '*:file: _pbm'
|
':overlay file:_pbm' '*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -211,7 +318,11 @@ pnmconvol)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmcrop)
|
pnmcrop)
|
||||||
_arguments -{white,black} ':file: _pbm'
|
_arguments \
|
||||||
|
'(-black)-white' \
|
||||||
|
'(-white)-black' \
|
||||||
|
-{left,right,top,bottom} \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmcut)
|
pnmcut)
|
||||||
|
|
@ -227,7 +338,7 @@ pnmenlarge)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmflip)
|
pnmflip)
|
||||||
_arguments -{leftright,lr,topbottom,tb,transpose,xy,rotate90,r90,ccw,rotate270,r270,cw} \
|
_arguments \*-{leftright,lr,topbottom,tb,transpose,xy,rotate90,r90,ccw,rotate270,r270,cw} \
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -246,18 +357,34 @@ pnmgamma)
|
||||||
return ret
|
return ret
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
pnmhisteq)
|
||||||
|
_arguments \
|
||||||
|
'-verbose[verbose mode]' \
|
||||||
|
'-gray[modify only gray pixels]' \
|
||||||
|
'-rmap[specify input luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \
|
||||||
|
'-wmap[specify output luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \
|
||||||
|
':file: _pbm'
|
||||||
|
;;
|
||||||
pnmhistmap)
|
pnmhistmap)
|
||||||
_arguments -{black,white,verbose} '-max:maximum value:' ':file: _pbm'
|
_arguments -{black,white,verbose} '-max:maximum value:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmindex)
|
pnmindex)
|
||||||
_arguments '-size:image size:' '-across:images per row:' \
|
_arguments \
|
||||||
'-colors:number of colors:' '-black' '*:file: _pbm'
|
'-size[set size of index pictures]:image size:' \
|
||||||
|
'-across[specify number of pictures per ros]:images per row:' \
|
||||||
|
'-colors[specify maximum number of colors]:number of colors:' \
|
||||||
|
'-black[use black padding]' \
|
||||||
|
'*:file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmmargin)
|
pnmmargin)
|
||||||
_arguments -{white,black} '-color:color: _x_color' \
|
_arguments \
|
||||||
':border width:' ':file: _pbm'
|
'(-black -colors)-white' \
|
||||||
|
'(-white -colors)-black' \
|
||||||
|
'(-white -black)-color:color: _x_color' \
|
||||||
|
':border width:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmnlfilt)
|
pnmnlfilt)
|
||||||
|
|
@ -265,14 +392,25 @@ pnmnlfilt)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmpad)
|
pnmpad)
|
||||||
_arguments -{black,white} \
|
_arguments \
|
||||||
-{l-:left,r-:right,t-:top,b-:bottom}' border width:' \
|
'(-white)-black[add black border]' \
|
||||||
|
'(-black)-white[add white border]' \
|
||||||
|
'-l-[specify left border width]:left border width:' \
|
||||||
|
'-r-[specify right border width]:right border width:' \
|
||||||
|
'-t-[specify top border width]:top border width:' \
|
||||||
|
'-b-[specify bottom border width]:bottom border width:' \
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmpaste)
|
pnmpaste)
|
||||||
_arguments -{replace,or,and,xor} ':"from" picture file:_pbm' \
|
_arguments \
|
||||||
:{x,y}' position:' ':"into" picture file:_pbm'
|
'(-or -and -xor)-replace' \
|
||||||
|
'(-replace -and -xor)-or' \
|
||||||
|
'(-replace -or -xor)-and' \
|
||||||
|
'(-replace -or -and)-xor' \
|
||||||
|
':"from" picture file:_pbm' \
|
||||||
|
:{x,y}' position:' \
|
||||||
|
':"into" picture file:_pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmrotate)
|
pnmrotate)
|
||||||
|
|
@ -288,10 +426,16 @@ pnmscale)
|
||||||
scale=( ':scale factor:' )
|
scale=( ':scale factor:' )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_arguments -{xsize,width}:width: -{ysize,height}:height: \
|
_arguments \
|
||||||
|
'(-width)-xsize:width:' \
|
||||||
|
'(-xsize)-width:width:' \
|
||||||
|
'(-height)-ysize:height:' \
|
||||||
|
'(-ysize)-height:height:' \
|
||||||
'-xscale:horizontal scale factor:' \
|
'-xscale:horizontal scale factor:' \
|
||||||
'-yscale:vertical scale factor:' \
|
'-yscale:vertical scale factor:' \
|
||||||
'-xysize:width::height:' "$scale[@]" \
|
'(-width -xsize -height -ysize -xscale -yscale -pixels)-xysize:width::height:' \
|
||||||
|
'(-width -xsize -height -ysize -xscale -yscale -xysize)-pixels:total number of pixels:' \
|
||||||
|
"$scale[@]" \
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -313,21 +457,37 @@ pnmtofits)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmtops)
|
pnmtops)
|
||||||
_arguments -{turn,noturn,rle,runlength} '-scale:scale factor:' \
|
_arguments \
|
||||||
|
'(-noturn)-turn' '(-turn)-noturn' \
|
||||||
|
'(-nocenter)-center '(-center)-nocenter \
|
||||||
|
'(-rle)-runlength' '(-runlength)-rle' \
|
||||||
|
'-scale:scale factor:' \
|
||||||
'-dpi:output resolution:' \
|
'-dpi:output resolution:' \
|
||||||
'-width:page width:' '-height:page height' ':file: _pbm'
|
'-width:page width:' '-height:page height' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmtorast)
|
pnmtorast)
|
||||||
_arguments -{standard,rle} ':file: _pbm'
|
_arguments '(-rle)-standard' '(-standard)-rle' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmtosgi)
|
pnmtosgi)
|
||||||
_arguments -{verbatim,rle} '-imagename:image name:' ':file: _pbm'
|
_arguments \
|
||||||
|
'(-rle)-verbatim' '(-verbatim)-rle' \
|
||||||
|
'-imagename:image name:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pnmtotiff)
|
pnmtotiff)
|
||||||
_arguments -{none,packbits,lzw,g3,g4,2d,fill,msb2lsb,lsb2msb} \
|
_arguments \
|
||||||
|
'(-packbits -lzw -g3 -g4 -2d -fill -predictor)-none' \
|
||||||
|
'(-none -lzw -g3 -g4 -2d -fill -predictor)-packbits' \
|
||||||
|
'(-none -packbits -g3 -g4 -2d -fill -predictor)-lzw' \
|
||||||
|
'(-none -packbits -lzw -g4 -predictor)-g3' \
|
||||||
|
'(-none -packbits -lzw -g3 -2d -fill -predictor)-g4' \
|
||||||
|
'-2d' \
|
||||||
|
'-fill' \
|
||||||
|
'(-lsb2msb)-msb2lsb' \
|
||||||
|
'(-msb2lsb)-lsb2msb' \
|
||||||
'-predictor:LZW predictor:((1\:without\ differencing 2\:with\ differencing))' \
|
'-predictor:LZW predictor:((1\:without\ differencing 2\:with\ differencing))' \
|
||||||
'-rowsperstrip:number of rows per strip:' ':file: _pbm'
|
'-rowsperstrip:number of rows per strip:' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
@ -342,16 +502,20 @@ ppm3d)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmbrighten)
|
ppmbrighten)
|
||||||
_arguments '-n' '-s:saturation:' '-v:value:' ':file: _pbm'
|
_arguments \
|
||||||
|
'-n[normalize value]' \
|
||||||
|
'-s[specify saturation difference]:saturation difference:' \
|
||||||
|
'-v[specify value difference]:value difference:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmchange)
|
ppmchange)
|
||||||
_pbm && ret=0
|
_pbm && ret=0
|
||||||
|
|
||||||
if (( CURRENT & 1 )); then
|
if (( CURRENT & 1 )); then
|
||||||
_description expl 'new color'
|
_description colors expl 'new color'
|
||||||
else
|
else
|
||||||
_description expl 'old color'
|
_description colors expl 'old color'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_x_color "$expl[@]" && ret=0
|
_x_color "$expl[@]" && ret=0
|
||||||
|
|
@ -364,7 +528,10 @@ ppmdim)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmdist)
|
ppmdist)
|
||||||
_arguments -{intensity,frequency} ':file: _pbm'
|
_arguments \
|
||||||
|
'(-frequency)-intensity[sort colors by grayscale intensity]' \
|
||||||
|
'(-intensity)-frequency[sort colors by frequency]' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmdither)
|
ppmdither)
|
||||||
|
|
@ -382,14 +549,15 @@ ppmflash)
|
||||||
ppmforge)
|
ppmforge)
|
||||||
_arguments -{clouds,night} \
|
_arguments -{clouds,night} \
|
||||||
'-dimension:fractal dimension:' '-hour:hour angle:' \
|
'-dimension:fractal dimension:' '-hour:hour angle:' \
|
||||||
'-inclination:inclination angle:' \
|
'(-tilt)-inclination:inclination angle:' \
|
||||||
'-tilt:inclination angle:' \
|
'(-inclination)-tilt:inclination angle:' \
|
||||||
'-mesh:FFT mesh size:' '-power:elevations power factor:' \
|
'-mesh:FFT mesh size:' '-power:elevations power factor:' \
|
||||||
'-glaciers:glacier elevation:' '-ice:polar ice cap extent:' \
|
'-glaciers:glacier elevation:' '-ice:polar ice cap extent:' \
|
||||||
'-saturation:star color saturation:' \
|
'-saturation:star color saturation:' \
|
||||||
'-seed:randum number seed:' \
|
'-seed:randum number seed:' \
|
||||||
'-stars:minimum star pixel percentage:' \
|
'-stars:minimum star pixel percentage:' \
|
||||||
-{width,xsize}:width: -{height,ysize}:height:
|
'(-xsize)-width:width:' '(-width)-xsize:width:' \
|
||||||
|
'(-ysize)-height:height:' '(-height)-ysize:height:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmmake)
|
ppmmake)
|
||||||
|
|
@ -405,7 +573,7 @@ ppmntsc)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmpat)
|
ppmpat)
|
||||||
_arguments -{gingham{2,3},g{2,3},madras,tartan,poles,squig,camo,anticamo} \
|
_arguments '(gingham2 -gingham3 -g2 -g3 -madras -tartan -poles -squig -camo -anticamo)'-{gingham{2,3},g{2,3},madras,tartan,poles,squig,camo,anticamo} \
|
||||||
':width:' ':height:'
|
':width:' ':height:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -419,17 +587,16 @@ ppmquant)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ CURRENT -eq 2 ]]; then
|
if [[ CURRENT -eq 2 ]]; then
|
||||||
_description expl option
|
|
||||||
if [[ -n "$opt" ]]; then
|
if [[ -n "$opt" ]]; then
|
||||||
compadd "$expl[@]" - -map -fs -floyd && ret=0
|
_wanted options expl option compadd - -map -fs -floyd && ret=0
|
||||||
else
|
else
|
||||||
compadd "$expl[@]" - -map && ret=0
|
_wanted options expl option compadd - -map && ret=0
|
||||||
fi
|
fi
|
||||||
_message 'number of colors'
|
_message 'number of colors'
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
|
elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
|
||||||
_description expl 'map file'
|
_description files expl 'map file'
|
||||||
_files "$expl[@]" -g '*.(#i)ppm'
|
_files "$expl[@]" -g '*.(#i)ppm'
|
||||||
else
|
else
|
||||||
_pbm
|
_pbm
|
||||||
|
|
@ -449,12 +616,18 @@ ppmspread)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmtoacad)
|
ppmtoacad)
|
||||||
_arguments -{dxb,poly,white,8} '-background:background color:_x_color' \
|
_arguments \
|
||||||
'-aspect:pixel aspect ratio:' ':file: _pbm'
|
'(-poly)-dxb[write AutoCAD binary database import file]' \
|
||||||
|
'(-dxb)-poly[render pixels as filled polygons]' \
|
||||||
|
'-8[restrict colors to the 8 RGB shades]' \
|
||||||
|
'(-background)-white[use white background]' \
|
||||||
|
'(-white)-background:background color (0-255):' \
|
||||||
|
'-aspect:pixel aspect ratio:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmtobmp)
|
ppmtobmp)
|
||||||
_arguments -{os2,windows} ':file: _pbm'
|
_arguments '(-windows)-os2' '(-os2)-windows' ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmtogif)
|
ppmtogif)
|
||||||
|
|
@ -490,11 +663,16 @@ ppmtopj)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppmtopjxl)
|
ppmtopjxl)
|
||||||
_arguments -{nopack,presentation,dark,diffuse,cluster,dither} \
|
_arguments \
|
||||||
|
-{nopack,presentation,dark,diffuse,cluster,dither} \
|
||||||
'-gamma:gamma value:' \
|
'-gamma:gamma value:' \
|
||||||
'-xshift:x shift:' '-yshift:y shift:' \
|
'-xshift:x shift:' '-yshift:y shift:' \
|
||||||
-{xscale:x,yscale:y}' scale factor:' \
|
'(-width -xscale)-xscale:width:' \
|
||||||
-{xsize,width}:width: -{ysize,height}:height: \
|
'(-xsize -xscale)-width:width:' \
|
||||||
|
'(-xsize -width)-xscale:horizontal scale factor:' \
|
||||||
|
'(-height -yscale)-ysize:height:' \
|
||||||
|
'(-ysize -yscale)-height:height:' \
|
||||||
|
'(-ysize -height)-yscale:vertical scale factor:' \
|
||||||
':file: _pbm'
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -518,9 +696,14 @@ psidtopgm)
|
||||||
_arguments ':width:' ':height:' ':bits per sample:' \
|
_arguments ':width:' ':height:' ':bits per sample:' \
|
||||||
':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
|
':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pstopnm)
|
pstopnm)
|
||||||
_arguments -{forceplain,help,landscape,portrait,nocrop,pbm,pgm,ppm,verbose} \
|
_arguments \
|
||||||
|
'(-portrait)-landscape' \
|
||||||
|
'(-landscape)-portrait' \
|
||||||
|
'(-pgm -ppm)-pbm' \
|
||||||
|
'(-pbm -ppm)-pgm' \
|
||||||
|
'(-pbm -pgm)-ppm' \
|
||||||
|
-{forceplain,help,nocrop,verbose} \
|
||||||
'-llx:loxer left x position:' '-lly:lower left y position:' \
|
'-llx:loxer left x position:' '-lly:lower left y position:' \
|
||||||
'-urx:upper right x position:' '-ury:upper right y position:' \
|
'-urx:upper right x position:' '-ury:upper right y position:' \
|
||||||
'-xborder:x border fraction:' '-yborder:y border fraction:' \
|
'-xborder:x border fraction:' '-yborder:y border fraction:' \
|
||||||
|
|
@ -536,9 +719,12 @@ rawtopgm)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rawtoppm)
|
rawtoppm)
|
||||||
_arguments '-headerskip:header bytes to skip:' \
|
_arguments \
|
||||||
|
'-headerskip:header bytes to skip:' \
|
||||||
'-rowskip:row padding to skip:' \
|
'-rowskip:row padding to skip:' \
|
||||||
-{rgb,rbg,grb,gbr,brg,bgr,interpixel,interrow} \
|
'(-rgb -rbg -grb -gbr -brg -bgr)'-{rgb,rbg,grb,gbr,brg,bgr} \
|
||||||
|
'(-interrow)-interpixel' \
|
||||||
|
'(-interpixel)-interrow' \
|
||||||
':width:' ':height:' ':grayscale bytes:'
|
':width:' ':height:' ':grayscale bytes:'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -552,7 +738,7 @@ rgb3toppm)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$expl" ]]; then
|
if [[ -n "$expl" ]]; then
|
||||||
_description expl "$expl"
|
_description files expl "$expl"
|
||||||
_files "$expl" -g '*.(#i)pgm'
|
_files "$expl" -g '*.(#i)pgm'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
@ -563,9 +749,11 @@ sgitopnm)
|
||||||
|
|
||||||
sldtoppm)
|
sldtoppm)
|
||||||
_arguments -{adjust,dir,info,verbose} \
|
_arguments -{adjust,dir,info,verbose} \
|
||||||
-{width,xsize}:width: -{height,ysize}:height: \
|
'(-width -xsize)'-{width,xsize}:width: \
|
||||||
|
'(-height -ysize)'-{height,ysize}:height: \
|
||||||
'-scale:scale factor:' \
|
'-scale:scale factor:' \
|
||||||
'-lib:slide name:' '-Lib:slide name:' ':file: _pbm'
|
'(-lib -Lib)'-{l,L}'ib:slide name:' \
|
||||||
|
':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
yuvsplittoppm)
|
yuvsplittoppm)
|
||||||
|
|
@ -577,10 +765,10 @@ yuvtoppm)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
zeisstopnm)
|
zeisstopnm)
|
||||||
_arguments -p{g,p}m ':file: _pbm'
|
_arguments '(-pgm -ppm)'-p{g,p}m ':file: _pbm'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
_description expl 'picture file'
|
_wanted files expl 'picture file' _path_files -g "$pat" ||
|
||||||
_path_files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m'
|
_files "$expl[@]" -g '*.(#i)p[bgp]m'
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef epsffit extractres fixdlsrps fixfmps fixmacps fixpsditps fixpspps fixscribeps fixtpps fixwfwps fixwpps fixwwps includeres psbook psmerge psnup psresize psselect pstops getafm showchar
|
#compdef epsffit extractres fixdlsrps fixfmps fixmacps fixpsditps fixpspps fixscribeps fixtpps fixwfwps fixwpps fixwwps includeres psbook psmerge psnup psresize psselect pstops getafm showchar
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
epsffit)
|
epsffit)
|
||||||
_arguments \
|
_arguments \
|
||||||
'-v[print version]' \
|
'-v[print version]' \
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
#defcomp co ci rcs
|
#compdef co ci rcs
|
||||||
|
|
||||||
[[ $COMMAND = ci || $COMMAND = rcs ]] && _files
|
local nm=$compstate[nmatches] cmd="${words[1]:t}"
|
||||||
|
|
||||||
|
[[ $cmd = ci || $cmd = rcs ]] && _files
|
||||||
|
|
||||||
|
if [[ $compstate[nmatches] -eq nm && -d RCS && $cmd != ci ]]; then
|
||||||
|
local rep expl
|
||||||
|
|
||||||
if [[ $NMATCHES -eq 0 && -d RCS && $COMMAND != ci ]]; then
|
|
||||||
local rep
|
|
||||||
rep=(RCS/$PREFIX*$SUFFIX,v(:t:s/\,v//))
|
rep=(RCS/$PREFIX*$SUFFIX,v(:t:s/\,v//))
|
||||||
(( $#rep )) && compadd -m $rep
|
(( $#rep )) && _wanted files expl 'RCS file' compadd - $rep
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,74 @@
|
||||||
#defcomp rlogin rsh ssh
|
#compdef rlogin rsh remsh rcp
|
||||||
|
|
||||||
if [[ -position 1 ]]; then
|
_rlogin () {
|
||||||
complist -k hosts
|
case "${words[1]:t}" in
|
||||||
elif [[ -position 2 ]]; then
|
rlogin)
|
||||||
complist -k '(-l)'
|
_arguments -s \
|
||||||
else
|
'-8[allow 8-Bit data]' \
|
||||||
complist -u
|
'-e-[specify escape character]:escape character:' \
|
||||||
fi
|
'-l[specify login user name]:login as:_rlogin_users' \
|
||||||
|
':remote host name:_rlogin_hosts'
|
||||||
|
;;
|
||||||
|
rsh|remsh)
|
||||||
|
local context state line ret=1
|
||||||
|
typeset -A opt_args
|
||||||
|
|
||||||
|
_arguments -s \
|
||||||
|
'-n[ignore stdin]' \
|
||||||
|
'-l[specify login user name]:login as:_rlogin_users' \
|
||||||
|
':remote host name:_rlogin_hosts' \
|
||||||
|
':command: _command_names -e' \
|
||||||
|
'*::command:->command' && ret=0
|
||||||
|
|
||||||
|
if [[ -n "$state" ]]; then
|
||||||
|
shift 1 words
|
||||||
|
(( CURRENT-- ))
|
||||||
|
_normal && ret=0
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
|
;;
|
||||||
|
rcp)
|
||||||
|
local curcontext="$curcontext" state line ret=1
|
||||||
|
typeset -A opt_args
|
||||||
|
|
||||||
|
_arguments -C -s \
|
||||||
|
'-p[preserve modification times]' \
|
||||||
|
'-r[recursively copy directories]' \
|
||||||
|
'*:files:->files' && ret=0
|
||||||
|
|
||||||
|
if [[ -n "$state" ]]; then
|
||||||
|
if compset -P '*:'; then
|
||||||
|
_files && ret=0
|
||||||
|
elif compset -P '*@'; then
|
||||||
|
_wanted hosts && _rlogin_hosts -S: -q && ret=0
|
||||||
|
else
|
||||||
|
_alternative \
|
||||||
|
'files:: _files' \
|
||||||
|
'hosts:: _rlogin_all_hosts -qS:' \
|
||||||
|
'users:: _rlogin_users -qS@' && ret=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_rlogin_users () {
|
||||||
|
_wanted users && _combination -s '[:@]' my-accounts users-hosts users "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_rlogin_hosts () {
|
||||||
|
_wanted hosts &&
|
||||||
|
if [[ "$IPREFIX" == *@ ]]; then
|
||||||
|
_combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@"
|
||||||
|
else
|
||||||
|
_combination -s '[:@]' my-accounts users-hosts \
|
||||||
|
${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_rlogin_all_hosts () {
|
||||||
|
_tags hosts && _combination -s '[:@]' my-accounts users-hosts hosts "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_rlogin "$@"
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,36 @@
|
||||||
#compdef ssh ssh-add ssh-agent ssh-keygen
|
#compdef ssh slogin scp ssh-add ssh-agent ssh-keygen
|
||||||
|
|
||||||
local state lstate line ret=1 expl
|
_remote_files () {
|
||||||
typeset -A options
|
# This is extremely simple-minded; could parse "ls -F" output to do
|
||||||
|
# colorings and LIST_TYPES and so on, but I'm just not that ambitious.
|
||||||
|
compadd $(ssh ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*)
|
||||||
|
}
|
||||||
|
|
||||||
case "$words[1]" in
|
_ssh () {
|
||||||
ssh)
|
local curcontext="$curcontext" state lstate line ret=1 expl args tmp
|
||||||
_arguments -s \
|
typeset -A opt_args
|
||||||
|
|
||||||
|
args=()
|
||||||
|
|
||||||
|
# ssh-opt is a pseudo-command used to complete ssh options for `scp -o'.
|
||||||
|
|
||||||
|
case "${words[1]:t}" in
|
||||||
|
ssh|slogin)
|
||||||
|
args=(
|
||||||
|
':remote host name:->userhost'
|
||||||
|
':command: _command_names -e'
|
||||||
|
'*::args:->command'
|
||||||
|
)
|
||||||
|
;&
|
||||||
|
ssh-opt)
|
||||||
|
_arguments -C -s \
|
||||||
'-a[disable forwarding of authentication agent connection]' \
|
'-a[disable forwarding of authentication agent connection]' \
|
||||||
'-c[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)' \
|
'-c[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)' \
|
||||||
'-e[set escape character]:escape character (or `none'"'"'):' \
|
'-e[set escape character]:escape character (or `none'"'"'):' \
|
||||||
'(-n)-f[go to background]' \
|
'(-n)-f[go to background]' \
|
||||||
'-i[select identity file]:SSH identity file:_files' \
|
'-i[select identity file]:SSH identity file:_files' \
|
||||||
'-k[disable forwarding of kerberos tickets]' \
|
'-k[disable forwarding of kerberos tickets]' \
|
||||||
'-l[specify login name]:login name:_users' \
|
'-l[specify login name]:login name:_ssh_users' \
|
||||||
'-n[redirect stdin from /dev/null]' \
|
'-n[redirect stdin from /dev/null]' \
|
||||||
'*-o[specify extra options]:option string:->option' \
|
'*-o[specify extra options]:option string:->option' \
|
||||||
'-p[specify port on remote host]:port number on remote host:' \
|
'-p[specify port on remote host]:port number on remote host:' \
|
||||||
|
|
@ -25,9 +43,7 @@ ssh)
|
||||||
'-C[compress all data]' \
|
'-C[compress all data]' \
|
||||||
'-L[specify local port forwarding]:local port forwarding:->forward' \
|
'-L[specify local port forwarding]:local port forwarding:->forward' \
|
||||||
'-R[specify remote port forwarding]:remote port forwarding:->forward' \
|
'-R[specify remote port forwarding]:remote port forwarding:->forward' \
|
||||||
':remote host name:_hosts' \
|
"$args[@]" && ret=0
|
||||||
':command: _command_names -e' \
|
|
||||||
'*::args:->command' && ret=0
|
|
||||||
|
|
||||||
while [[ -n "$state" ]]; do
|
while [[ -n "$state" ]]; do
|
||||||
lstate="$state"
|
lstate="$state"
|
||||||
|
|
@ -35,25 +51,24 @@ ssh)
|
||||||
|
|
||||||
case "$lstate" in
|
case "$lstate" in
|
||||||
option)
|
option)
|
||||||
if compset -P '* '; then
|
if compset -P '*[= ]'; then
|
||||||
case "$IPREFIX" in
|
case "$IPREFIX" in
|
||||||
*(#i)(batchmode|compression|fallbacktorsh|forward(agent|x11)|keepalive|passwordauthentication|rhosts(|rsa)authentication|rsaauthentication|usersh|kerberos(authetication|tgtparsing)|usepriviledgedport)*)
|
*(#i)(batchmode|compression|fallbacktorsh|forward(agent|x11)|keepalive|passwordauthentication|rhosts(|rsa)authentication|rsaauthentication|usersh|kerberos(authetication|tgtparsing)|usepriviledgedport)*)
|
||||||
compadd yes no && ret=0
|
_wanted values expl 'truth value' compadd yes no && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)cipher*)
|
*(#i)cipher*)
|
||||||
_description expl 'encryption cipher'
|
_wanted values expl 'encryption cipher' \
|
||||||
compadd "$expl[@]" idea des 3des blowfish arcfour tss none && ret=0
|
compadd idea des 3des blowfish arcfour tss none && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)globalknownhostsfile*)
|
*(#i)globalknownhostsfile*)
|
||||||
_description expl 'global file with known hosts'
|
_description files expl 'global file with known hosts'
|
||||||
_files "$expl[@]" && ret=0
|
_files "$expl[@]" && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)hostname*)
|
*(#i)hostname*)
|
||||||
_description expl 'real host name to log into'
|
_wanted hosts expl 'real host name to log into' _ssh_hosts && ret=0
|
||||||
_hosts "$expl[@]" && ret=0
|
|
||||||
;;
|
;;
|
||||||
*(#i)identityfile*)
|
*(#i)identityfile*)
|
||||||
_description expl 'SSH identity file'
|
_description files expl 'SSH identity file'
|
||||||
_files "$expl[@]" && ret=0
|
_files "$expl[@]" && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)(local|remote)forward*)
|
*(#i)(local|remote)forward*)
|
||||||
|
|
@ -66,31 +81,32 @@ ssh)
|
||||||
_normal && ret=0
|
_normal && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)stricthostkeychecking*)
|
*(#i)stricthostkeychecking*)
|
||||||
compadd yes no ask
|
_wanted values expl 'checking type' compadd yes no ask && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)userknownhostsfile*)
|
*(#i)userknownhostsfile*)
|
||||||
_description expl 'user file with known hosts'
|
_description files expl 'user file with known hosts'
|
||||||
_files "$expl[@]" && ret=0
|
_files "$expl[@]" && ret=0
|
||||||
;;
|
;;
|
||||||
*(#i)user*)
|
*(#i)user*)
|
||||||
_description expl 'user to log in as'
|
_wanted users expl 'user to log in as' _ssh_users && ret=0
|
||||||
_users "$expl[@]" && ret=0
|
|
||||||
;;
|
;;
|
||||||
*(#i)xauthlocation*)
|
*(#i)xauthlocation*)
|
||||||
_description expl 'xauth program'
|
_description files expl 'xauth program'
|
||||||
_files "$expl[@]" -g '*(*)' && ret=0
|
_files "$expl[@]" -g '*(-*)' && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
_description expl 'configure file option'
|
_wanted values expl 'configure file option' \
|
||||||
compadd "$expl[@]" -M 'm:{a-z}={A-Z}' -S ' ' - \
|
compadd -M 'm:{a-z}={A-Z}' -S '=' - \
|
||||||
BatchMode ClearAllForwardings Cipher Compression CompressionLevel \
|
BatchMode ClearAllForwardings Cipher Compression \
|
||||||
Host ConnectionAttempts EscapeChar FallBackToRsh ForwardAgent \
|
CompressionLevel Host ConnectionAttempts EscapeChar \
|
||||||
ForwardX11 GlobalKnownHostsFile HostName IdentityFile KeepAlive \
|
FallBackToRsh ForwardAgent ForwardX11 \
|
||||||
|
GlobalKnownHostsFile HostName IdentityFile KeepAlive \
|
||||||
KerberosAuthentication KerberosTgtPassing LocalForward \
|
KerberosAuthentication KerberosTgtPassing LocalForward \
|
||||||
NumberOfPasswordPrompts PasswordAuthentication Port ProxyCommand \
|
NumberOfPasswordPrompts PasswordAuthentication Port \
|
||||||
RemoteForward RhostsAuthentication RhostsRSAAuthentication \
|
ProxyCommand RemoteForward RhostsAuthentication \
|
||||||
RSAAuthentication StrictHostKeyChecking TISAuthentication \
|
RhostsRSAAuthentication RSAAuthentication \
|
||||||
|
StrictHostKeyChecking TISAuthentication \
|
||||||
UsePriviledgedPort User UserKnownHostsFile UseRsh \
|
UsePriviledgedPort User UserKnownHostsFile UseRsh \
|
||||||
XAuthLocation && ret=0
|
XAuthLocation && ret=0
|
||||||
fi
|
fi
|
||||||
|
|
@ -100,7 +116,7 @@ ssh)
|
||||||
if compset -P '*:'; then
|
if compset -P '*:'; then
|
||||||
_message 'port number'
|
_message 'port number'
|
||||||
else
|
else
|
||||||
_hosts -S:
|
_wanted hosts expl host _ssh_hosts -qS:
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
_message 'listen-port number'
|
_message 'listen-port number'
|
||||||
|
|
@ -113,6 +129,20 @@ ssh)
|
||||||
_normal
|
_normal
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
userhost)
|
||||||
|
if compset -P '*@'; then
|
||||||
|
_wanted hosts expl 'remote host name' _ssh_hosts && ret=0
|
||||||
|
else
|
||||||
|
if (( $+opt_args[-l] )); then
|
||||||
|
tmp=()
|
||||||
|
else
|
||||||
|
tmp=( 'users:login name:_ssh_users -qS@' )
|
||||||
|
fi
|
||||||
|
_alternative \
|
||||||
|
'hosts:remote host name:_ssh_hosts' \
|
||||||
|
"$tmp[@]" && ret=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
@ -120,7 +150,41 @@ ssh)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
;;
|
;;
|
||||||
ssh-add)
|
scp)
|
||||||
|
_arguments -C -s \
|
||||||
|
'-c[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)' \
|
||||||
|
'-P[specify port on remote host]:port number on remote host:' \
|
||||||
|
'-i[select identity file]:SSH identity file:_files' \
|
||||||
|
'-S[specify path to ssh]:path to ssh:_files -g \*\(-\*\)' \
|
||||||
|
'-o[give SSH options]:options:->options' \
|
||||||
|
'-p[preserve modification times]' \
|
||||||
|
'-r[recursively copy directories]' \
|
||||||
|
'-v[verbose mode]' \
|
||||||
|
'-B[batch mode]' \
|
||||||
|
'-C[compress data]' \
|
||||||
|
'*:file:->file' && ret=0
|
||||||
|
|
||||||
|
if [[ "$state" = options ]]; then
|
||||||
|
compset -q
|
||||||
|
words=(ssh-opt "$words[@]" )
|
||||||
|
(( CURRENT++ ))
|
||||||
|
_ssh
|
||||||
|
return
|
||||||
|
elif [[ -n "$state" ]]; then
|
||||||
|
if compset -P '*:'; then
|
||||||
|
_remote_files && ret=0
|
||||||
|
elif compset -P '*@'; then
|
||||||
|
_wanted hosts expl host _ssh_hosts -S: && ret=0
|
||||||
|
else
|
||||||
|
_alternative \
|
||||||
|
'files:: _files' \
|
||||||
|
'hosts:host:_ssh_hosts -S:' \
|
||||||
|
'users:user:_ssh_users -S@' && ret=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
|
;;
|
||||||
|
ssh-add)
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'-p[read passphrase from stdin]' \
|
'-p[read passphrase from stdin]' \
|
||||||
'-l[list all identities]' \
|
'-l[list all identities]' \
|
||||||
|
|
@ -129,7 +193,7 @@ ssh-add)
|
||||||
'*:SSH identity file:_files'
|
'*:SSH identity file:_files'
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
ssh-agent)
|
ssh-agent)
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'(:)-k[kill agent automatically]' \
|
'(:)-k[kill agent automatically]' \
|
||||||
'(:)-s[force sh-style shell]' \
|
'(:)-s[force sh-style shell]' \
|
||||||
|
|
@ -137,7 +201,7 @@ ssh-agent)
|
||||||
'*::command: _normal'
|
'*::command: _normal'
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
ssh-keygen)
|
ssh-keygen)
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-p -c -u -P)-b[specify number of bits in key]:bits in key:' \
|
'(-p -c -u -P)-b[specify number of bits in key]:bits in key:' \
|
||||||
'(-p -c)-f[key file]:key file:_files' \
|
'(-p -c)-f[key file]:key file:_files' \
|
||||||
|
|
@ -149,4 +213,20 @@ ssh-keygen)
|
||||||
'(-b -N -C -p -c)-u[change key cipher to default]'
|
'(-b -N -C -p -c)-u[change key cipher to default]'
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_ssh_users () {
|
||||||
|
_combination -s '[:@]' my-accounts users-hosts users "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_ssh_hosts () {
|
||||||
|
if [[ "$IPREFIX" == *@ ]]; then
|
||||||
|
_combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@"
|
||||||
|
else
|
||||||
|
_combination -s '[:@]' my-accounts users-hosts \
|
||||||
|
${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_ssh "$@"
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#compdef -P (tiff*|*2tiff|pal2rgb)
|
#compdef -P (tiff*|*2tiff|pal2rgb)
|
||||||
|
|
||||||
local pat expl ret=1
|
local pat expl ret=1 cmd="${words[1]:t}"
|
||||||
|
|
||||||
if [[ "$words[1]" = *2tiff ]]; then
|
if [[ "$cmd" = *2tiff ]]; then
|
||||||
pat="*.(#i)${words[1]%%2tiff}"
|
pat="*.(#i)${cmd%%2tiff}"
|
||||||
else
|
else
|
||||||
pat="*.(#i)tiff"
|
pat="*.(#i)tiff"
|
||||||
fi
|
fi
|
||||||
|
|
@ -23,7 +23,7 @@ local _in_tiff=yes
|
||||||
local curcontext="$curcontext" state line ret=1
|
local curcontext="$curcontext" state line ret=1
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
case "$words[1]" in
|
case "$cmd" in
|
||||||
tiff2bw)
|
tiff2bw)
|
||||||
_arguments -C \
|
_arguments -C \
|
||||||
'-c[specify compression scheme]:compression scheme:->compress' \
|
'-c[specify compression scheme]:compression scheme:->compress' \
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
#compdef ypcat ypmatch yppasswd ypwhich ypset ypserv ypbind yppush yppoll ypxfr domainname
|
#compdef ypcat ypmatch yppasswd ypwhich ypset ypserv ypbind yppush yppoll ypxfr domainname
|
||||||
|
|
||||||
local line state ret=1
|
local curcontext="$curcontext" line state ret=1
|
||||||
typeset -A options
|
typeset -A opt_args
|
||||||
|
|
||||||
if (( ! $+_yp_cache_maps )); then
|
if (( ! $+_yp_cache_maps )); then
|
||||||
_yp_cache_maps=( "${(@)${(@f)$(ypwhich -m)}%% *}" )
|
_yp_cache_maps=( "${(@)${(@f)$(_call maps ypwhich -m)}%% *}" )
|
||||||
_yp_cache_nicks=( "${(@)${(@)${(@f)$(ypwhich -x)}#*\"}%%\"*}" )
|
_yp_cache_nicks=( "${(@)${(@)${(@f)$(_call names ypwhich -x)}#*\"}%%\"*}" )
|
||||||
_yp_args=(
|
_yp_args=(
|
||||||
'(-x)-d[specify domain]:domain name:' \
|
'(-x)-d[specify domain]:domain name:' \
|
||||||
'(-x)-k[display keys]' \
|
'(-x)-k[display keys]' \
|
||||||
|
|
@ -14,19 +14,19 @@ if (( ! $+_yp_cache_maps )); then
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
ypcat)
|
ypcat)
|
||||||
_arguments -s "$_yp_args[@]" ':map name:->map' && ret=0
|
_arguments -C -s "$_yp_args[@]" ':map name:->map' && ret=0
|
||||||
;;
|
;;
|
||||||
ypmatch)
|
ypmatch)
|
||||||
_arguments -s "$_yp_args[@]" '*::key map:->keymap' && ret=0
|
_arguments -C -s "$_yp_args[@]" '*::key map:->keymap' && ret=0
|
||||||
;;
|
;;
|
||||||
yppasswd)
|
yppasswd)
|
||||||
_users
|
_users
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
ypwhich)
|
ypwhich)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'(-x)-d[specify domain]:domain name:' \
|
'(-x)-d[specify domain]:domain name:' \
|
||||||
'(-x -V2 -m -t)-V1[identify version 1 servers]' \
|
'(-x -V2 -m -t)-V1[identify version 1 servers]' \
|
||||||
'(-x -V1 -m -t)-V2[identify version 2 servers]' \
|
'(-x -V1 -m -t)-V2[identify version 2 servers]' \
|
||||||
|
|
@ -36,7 +36,7 @@ ypwhich)
|
||||||
':host:_hosts' && ret=0
|
':host:_hosts' && ret=0
|
||||||
;;
|
;;
|
||||||
ypset)
|
ypset)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'(-V2)-V1[bind version 1 servers]' \
|
'(-V2)-V1[bind version 1 servers]' \
|
||||||
'(-V1)-V2[bind version 2 servers]' \
|
'(-V1)-V2[bind version 2 servers]' \
|
||||||
'-d[specify domain]:domain name:' \
|
'-d[specify domain]:domain name:' \
|
||||||
|
|
@ -44,30 +44,30 @@ ypset)
|
||||||
':server:_hosts' && ret=0
|
':server:_hosts' && ret=0
|
||||||
;;
|
;;
|
||||||
ypserv)
|
ypserv)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' && ret=0
|
'-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' && ret=0
|
||||||
;;
|
;;
|
||||||
ypbind)
|
ypbind)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'-s[allow secure mode for ypbind]' \
|
'-s[allow secure mode for ypbind]' \
|
||||||
'-S[set domain and servers]:domain:->servers' \
|
'-S[set domain and servers]:domain:->servers' \
|
||||||
'(-ypsetme)-ypset[accept all ypset requests]' \
|
'(-ypsetme)-ypset[accept all ypset requests]' \
|
||||||
'(-ypset)-ypsetme[accept only local ypset requests]' && ret=0
|
'(-ypset)-ypsetme[accept only local ypset requests]' && ret=0
|
||||||
;;
|
;;
|
||||||
yppush)
|
yppush)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'-d[specify domain]:domain name:' \
|
'-d[specify domain]:domain name:' \
|
||||||
'-v[print messages]' \
|
'-v[print messages]' \
|
||||||
':map name:->map' && ret=0
|
':map name:->map' && ret=0
|
||||||
;;
|
;;
|
||||||
yppoll)
|
yppoll)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'-d[specify domain]:domain name:' \
|
'-d[specify domain]:domain name:' \
|
||||||
'-h[specify host]:ask server on host:_hosts' \
|
'-h[specify host]:ask server on host:_hosts' \
|
||||||
':map name:->map' && ret=0
|
':map name:->map' && ret=0
|
||||||
;;
|
;;
|
||||||
ypxfr)
|
ypxfr)
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' \
|
'-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' \
|
||||||
'-f[force transfer]' \
|
'-f[force transfer]' \
|
||||||
'-c[don'"'"'t clear current map]' \
|
'-c[don'"'"'t clear current map]' \
|
||||||
|
|
@ -87,16 +87,24 @@ esac
|
||||||
if [[ "$state" = map* ]]; then
|
if [[ "$state" = map* ]]; then
|
||||||
local expl
|
local expl
|
||||||
|
|
||||||
_description expl 'map name'
|
if [[ $+opt_args[-t] -eq 0 && "$state" != maponly ]]; then
|
||||||
compadd "$expl[@]" - "$_yp_cache_maps[@]" && ret=0
|
_tags maps nicknames
|
||||||
if [[ $+options[-t] -eq 0 && "$state" != maponly ]]; then
|
else
|
||||||
_description expl 'nicknames'
|
_tags maps
|
||||||
compadd "$expl[@]" - "$_yp_cache_nicks[@]" && ret=0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
while _tags; do
|
||||||
|
# The `-M ...' allows `pa.n<TAB>' to complete to `passwd.byname'.
|
||||||
|
_requested maps expl 'map name' \
|
||||||
|
compadd -M 'l:.|by=by l:.|=by r:|.=* r:|=*' - \
|
||||||
|
"$_yp_cache_maps[@]" && ret=0
|
||||||
|
_requested nicknames expl nicknames \
|
||||||
|
compadd - "$_yp_cache_nicks[@]" && ret=0
|
||||||
|
(( ret )) || return 0
|
||||||
|
done
|
||||||
elif [[ "$state" = servers ]]; then
|
elif [[ "$state" = servers ]]; then
|
||||||
if compset -P '*,'; then
|
if compset -P '*,'; then
|
||||||
_description expl 'server'
|
_wanted hosts expl server _hosts -qS, && ret=0
|
||||||
_hosts -qS, && ret=0
|
|
||||||
else
|
else
|
||||||
_message 'domain name'
|
_message 'domain name'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef xdpyinfo xwininfo xkill xfontsel xfd xev xhost xon xsetroot xwd xwud xrdb
|
#compdef xdpyinfo xwininfo xkill xfontsel xfd xev xhost xon xsetroot xwd xwud xrdb
|
||||||
|
|
||||||
case "$words[1]" in
|
case "${words[1]:t}" in
|
||||||
xdpyinfo)
|
xdpyinfo)
|
||||||
_x_arguments \
|
_x_arguments \
|
||||||
-queryExtensions \
|
-queryExtensions \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue