mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
33467: correct return status on functions and numerous other minor fixes
This commit is contained in:
parent
66320ca93a
commit
13fc579343
45 changed files with 568 additions and 684 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
||||||
|
2014-10-14 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 33467: Completion/Debian/Command/_apt-move,
|
||||||
|
Completion/Debian/Command/_bts, Completion/Linux/Command/_sysstat,
|
||||||
|
Completion/Mandriva/Command/_urpmi, Completion/Redhat/Command/_rpm,
|
||||||
|
Completion/Solaris/Command/_ptree, Completion/Unix/Command/_arp,
|
||||||
|
Completion/Unix/Command/_at, Completion/Unix/Command/_bittorrent,
|
||||||
|
Completion/Unix/Command/_bogofilter, Completion/Unix/Command/_bpython,
|
||||||
|
Completion/Unix/Command/_bzr, Completion/Unix/Command/_cdrdao,
|
||||||
|
Completion/Unix/Command/_chmod, Completion/Unix/Command/_cpio,
|
||||||
|
Completion/Unix/Command/_df, Completion/Unix/Command/_django,
|
||||||
|
Completion/Unix/Command/_git, Completion/Unix/Command/_less,
|
||||||
|
Completion/Unix/Command/_lha, Completion/Unix/Command/_metaflac,
|
||||||
|
Completion/Unix/Command/_module, Completion/Unix/Command/_monotone,
|
||||||
|
Completion/Unix/Command/_mpc, Completion/Unix/Command/_netcat,
|
||||||
|
Completion/Unix/Command/_notmuch, Completion/Unix/Command/_pkg-config,
|
||||||
|
Completion/Unix/Command/_prove, Completion/Unix/Command/_rar,
|
||||||
|
Completion/Unix/Command/_rsync, Completion/Unix/Command/_rubber,
|
||||||
|
Completion/Unix/Command/_sablotron, Completion/Unix/Command/_screen,
|
||||||
|
Completion/Unix/Command/_stgit, Completion/Unix/Command/_strip,
|
||||||
|
Completion/Unix/Command/_systemd, Completion/Unix/Command/_telnet,
|
||||||
|
Completion/Unix/Command/_tidy, Completion/Unix/Command/_tmux,
|
||||||
|
Completion/Unix/Command/_vcsh, Completion/Unix/Command/_zpool,
|
||||||
|
Completion/Unix/Type/_users, Completion/X/Command/_urxvt,
|
||||||
|
Completion/X/Command/_x_utils: correct return status on functions
|
||||||
|
and numerous other minor fixes
|
||||||
|
|
||||||
2014-10-13 Peter Stephenson <p.stephenson@samsung.com>
|
2014-10-13 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
* 33459: Test/D04parameter.ztst: test for variable substitution
|
* 33459: Test/D04parameter.ztst: test for variable substitution
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef apt-move
|
#compdef apt-move
|
||||||
|
|
||||||
local curcontext="$curcontext" state line cmds ret=1
|
local curcontext="$curcontext" state line expl cmds ret=1
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
_arguments -C \
|
_arguments -C \
|
||||||
|
@ -45,7 +45,10 @@ case $state in
|
||||||
_files -g "*.d(sc|eb)(-.)" && ret=0
|
_files -g "*.d(sc|eb)(-.)" && ret=0
|
||||||
;;
|
;;
|
||||||
listbin)
|
listbin)
|
||||||
_wanted lists expl list compadd mirror sync repo
|
_wanted lists expl list compadd mirror sync repo && ret=0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_default && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -40,10 +40,12 @@ case "$words[1]" in
|
||||||
;;
|
;;
|
||||||
(show|bugs)
|
(show|bugs)
|
||||||
if [[ CURRENT -eq 2 ]]; then
|
if [[ CURRENT -eq 2 ]]; then
|
||||||
_wanted package expl 'package' _deb_packages avail
|
_alternative \
|
||||||
_wanted maintainer expl 'package maintainer' compadd $DEBEMAIL
|
'packages:package:_deb_packages avail' \
|
||||||
|
"emails:package maintainer:compadd $DEBEMAIL"
|
||||||
|
else
|
||||||
|
_wanted sep expl 'separator' compadd -S ' ' , .
|
||||||
fi
|
fi
|
||||||
_wanted sep expl 'separator' compadd -S ' ' , .
|
|
||||||
;;
|
;;
|
||||||
reopen)
|
reopen)
|
||||||
if [[ CURRENT -eq 2 ]]; then
|
if [[ CURRENT -eq 2 ]]; then
|
||||||
|
|
|
@ -4,80 +4,73 @@
|
||||||
# sysstat-nfsiostat - there seems to be two nfsiostat(1)s. one from oracle and one by redhat.
|
# sysstat-nfsiostat - there seems to be two nfsiostat(1)s. one from oracle and one by redhat.
|
||||||
|
|
||||||
_mpstat() {
|
_mpstat() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-A[equivalent to -u -I ALL -P ALL]' \
|
'-A[equivalent to -u -I ALL -P ALL]' \
|
||||||
'-I[report interrupt statistics]:interrupts:(SUM CPU SCPU ALL)' \
|
'-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \
|
||||||
'-P[specify processor number]:processor: _values -s "," processor ON ALL' \
|
'-P[specify processor number]:processor: _values -s "," processor ON ALL {1..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \
|
||||||
'-u[report CPU utilization]' \
|
'-u[report CPU utilization]' \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'1:interval:_guard "[0-9]#" "interval"' \
|
'1:interval' \
|
||||||
'2:count:_guard "[0-9]#" "count"' && ret=0
|
'2:count'
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_iostat() {
|
_iostat() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-c[display CPU utilization report]' \
|
'-c[display CPU utilization report]' \
|
||||||
'-d[display device utilization report]' \
|
'-d[display device utilization report]' \
|
||||||
'-T[only display global statistics for group_name]' \
|
'-T[only display global statistics for group_name]' \
|
||||||
'-g[display statistics for a group of devices]:group name: _message "group name"' \
|
'-g[display statistics for a group of devices]:group name' \
|
||||||
'-h[human readable device utilization report]' \
|
'-h[human readable device utilization report]' \
|
||||||
'-j[display persistent device name]' \
|
'-j[display persistent device name]' \
|
||||||
'(-m)-k[display statistics in kB/s]' \
|
'(-m)-k[display statistics in kB/s]' \
|
||||||
'(-k)-m[display statistics in MB/s]' \
|
'(-k)-m[display statistics in MB/s]' \
|
||||||
'-N[display registered device mapper names]' \
|
'-N[display registered device mapper names]' \
|
||||||
'1:interval:_guard "[0-9]#" "interval"' \
|
'::device:_files -W /dev -g "*(-%)"' \
|
||||||
'2:count:_guard "[0-9]#" "count"' && ret=0
|
': :_guard "[0-9]#" "interval"' \
|
||||||
return ret
|
':count'
|
||||||
}
|
}
|
||||||
|
|
||||||
_cifsiostat() {
|
_cifsiostat() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-h[human readable]' \
|
'-h[human readable]' \
|
||||||
'(-m)-k[display statistics in kB/s]' \
|
'(-m)-k[display statistics in kB/s]' \
|
||||||
'(-k)-m[display statistics in MB/s]' \
|
'(-k)-m[display statistics in MB/s]' \
|
||||||
'-t[print timestamp for each report]' \
|
'-t[print timestamp for each report]' \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'1:interval:_guard "[0-9]#" "interval"' \
|
'1:interval' \
|
||||||
'2:count:_guard "[0-9]#" "count"' && ret=0
|
'2:count'
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_isag() {
|
_isag() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-p[Pathname to daily data files]:data files: _files -/' \
|
'-p[specify path to daily data files]:path:_files -/' \
|
||||||
'-c[Specify configuration file]:configuration file: _files' \
|
'-c[specify configuration file]:configuration file:_files' \
|
||||||
'-ght[Specify height of the chart]:height: _message "height"' \
|
'-ght[specify height of the chart]:height' \
|
||||||
'-gwd[Specify width of the chart]:width: _message "width"' && ret=0
|
'-gwd[specify width of the chart]:width'
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_sadf() {
|
_sadf() {
|
||||||
local ret=1 line state context expl
|
local ret=1
|
||||||
typeset -A opt_args
|
|
||||||
# any options after `--' are for sar(1)
|
# any options after `--' are for sar(1)
|
||||||
if ! (( CURRENT > $words[(i)--] )); then
|
if ! (( CURRENT > $words[(i)--] )); then
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-C[display comments in file]' \
|
'-C[display comments in file]' \
|
||||||
'(-j -p -x)-d[output file in SQL format]' \
|
'(-j -p -x)-d[output file in SQL format]' \
|
||||||
'-e[set ending time of report]:ending time: _message "ending time in localtime(HH\:MM\:SS 24-hour format)"' \
|
'-e[set ending time of report]:ending time (HH\:MM\:SS)' \
|
||||||
'-H[display only the header of the report]' \
|
'-H[display only the header of the report]' \
|
||||||
'(-j -p -x)-h[print on a single line when used with -d]' \
|
'(-j -p -x)-h[print on a single line when used with -d]' \
|
||||||
'(-d -p -x)-j[output file in JSON]' \
|
'(-d -p -x)-j[output file in JSON]' \
|
||||||
'-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \
|
'-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \
|
||||||
'(-j -x -d)-p[print in format parsable by tools like awk]' \
|
'(-j -x -d)-p[print in format parsable by tools like awk]' \
|
||||||
'-s[set starting time of report]:starting time: _message "starting time in localtime(HH\:MM\:SS 24-hour format)"' \
|
'-s[set starting time of report]:starting time (HH\:MM\:SS)"' \
|
||||||
'(-t -U)-T[display timestamp in local time]' \
|
'(-t -U)-T[display timestamp in local time]' \
|
||||||
'(-T -U)-t[display timestamp in file\''s original localtime]' \
|
'(-T -U)-t[display timestamp in file\''s original localtime]' \
|
||||||
'(-t -T)-U[display in seconds from epoch(UTC)]' \
|
'(-t -T)-U[display in seconds since epoch (UTC)]' \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'(-j -d -p)-x[output file in XML]' \
|
'(-j -d -p)-x[output file in XML]' \
|
||||||
'1:interval:_guard "[0-9]#" "interval"' \
|
'1:interval' \
|
||||||
'2:count:_guard "[0-9]#" "count"' && ret=0
|
'2:count' \
|
||||||
|
'3:data file:_files' && ret=0
|
||||||
else
|
else
|
||||||
_arguments : '*::sar: _sar' && ret=0
|
_arguments : '*::sar: _sar' && ret=0
|
||||||
fi
|
fi
|
||||||
|
@ -85,20 +78,19 @@ _sadf() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sar() {
|
_sar() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL]' \
|
'-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL]' \
|
||||||
'-B[report paging statistics]' \
|
'-B[report paging statistics]' \
|
||||||
'-b[report I/O and transfer rate statistics]' \
|
'-b[report I/O and transfer rate statistics]' \
|
||||||
'-C[display comments from sadc]' \
|
'-C[display comments from sadc]' \
|
||||||
'-d[report activity for each block device]' \
|
'-d[report activity for each block device]' \
|
||||||
'-e[set ending time of report]:ending time: _message "ending time (HH\:MM\:SS 24-hour format)"' \
|
'-e[set ending time of report]:ending time (HH\:MM\:SS)' \
|
||||||
'-F[display statistics for mounted filesystems]' \
|
'-F[display statistics for mounted filesystems]' \
|
||||||
'-f[extract records from file]:record:_files' \
|
'-f[extract records from file]:record:_files' \
|
||||||
'-H[report hugepages utilization]' \
|
'-H[report hugepages utilization]' \
|
||||||
'-h[display help]' \
|
'-h[display help]' \
|
||||||
'*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \
|
'*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \
|
||||||
'-i[select records as close as possible to interval]:interval: _message "interval"' \
|
'-i[select records as close as possible to interval]:interval' \
|
||||||
'-j[display persistent device names]:type:(ID LABEL PATH UUID)' \
|
'-j[display persistent device names]:type:(ID LABEL PATH UUID)' \
|
||||||
'-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \
|
'-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \
|
||||||
'-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 ALL' \
|
'-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 ALL' \
|
||||||
|
@ -108,27 +100,25 @@ _sar() {
|
||||||
'-R[report memory statistics]' \
|
'-R[report memory statistics]' \
|
||||||
'-r[report memory utilization statistics]' \
|
'-r[report memory utilization statistics]' \
|
||||||
'-S[report swap space utilization]' \
|
'-S[report swap space utilization]' \
|
||||||
'-s[set starting time of report]:start time: _message "start time (HH\:MM\:SS 24-hour format)"' \
|
'-s[set starting time of report]:start time (HH\:MM\:SS)' \
|
||||||
'-u[report CPU utilization]: :(ALL)' \
|
'-u[report CPU utilization]: :(ALL)' \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'-v[report status of kernel tables]' \
|
'-v[report status of kernel tables]' \
|
||||||
'-W[report swapping statistics]' \
|
'-W[report swapping statistics]' \
|
||||||
'-w[report task creation and system switching activity]' \
|
'-w[report task creation and system switching activity]' \
|
||||||
'-y[report TTY device activity]' \
|
'-y[report TTY device activity]' \
|
||||||
'1:interval:_guard "[0-9]#" "interval"' \
|
'1:interval' \
|
||||||
'2:count:_guard "[0-9]#" "count"' && ret=0
|
'2:count'
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_pidstat() {
|
_pidstat() {
|
||||||
local ret=1
|
|
||||||
_arguments : \
|
_arguments : \
|
||||||
'-C[filter tasks by string]:task: _message "string or regex"' \
|
'-C[filter tasks by string]:task filter' \
|
||||||
'-d[report I/O statistics]' \
|
'-d[report I/O statistics]' \
|
||||||
'-h[display on horizontally]' \
|
'-h[display on horizontally]' \
|
||||||
'-I[divide CPU usage by number of processors]' \
|
'-I[divide CPU usage by number of processors]' \
|
||||||
'-l[display process name along with arguments]' \
|
'-l[display process name along with arguments]' \
|
||||||
'-p[select pid]:pid: _pids' \
|
'-p[select pid]:pid: _sequence _pids' \
|
||||||
'-r[report page faults and memory]' \
|
'-r[report page faults and memory]' \
|
||||||
'-s[report stack utilization]' \
|
'-s[report stack utilization]' \
|
||||||
'-T[specifies what to monitor]:type:(TASK CHILD ALL)' \
|
'-T[specifies what to monitor]:type:(TASK CHILD ALL)' \
|
||||||
|
@ -137,14 +127,13 @@ _pidstat() {
|
||||||
'-u[report cpu utilization]' \
|
'-u[report cpu utilization]' \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'-v[display values from kernel table]' \
|
'-v[display values from kernel table]' \
|
||||||
'-w[report task switching activity]' && ret=0
|
'-w[report task switching activity]' \
|
||||||
return ret
|
':interval' ':count'
|
||||||
}
|
}
|
||||||
|
|
||||||
_sysstat() {
|
_sysstat() {
|
||||||
local ret=1
|
local ret
|
||||||
_call_function ret _$service
|
_call_function ret _$service && return ret
|
||||||
return ret
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_sysstat "$@"
|
_sysstat "$@"
|
||||||
|
|
|
@ -1,24 +1,8 @@
|
||||||
#compdef urpme urpmi urpmi.addmedia urpmi.removemedia urpmi.update urpmq urpmf parsehdlist
|
#compdef urpme urpmi urpmi.addmedia urpmi.removemedia urpmi.update urpmq urpmf parsehdlist
|
||||||
|
|
||||||
_urpmi_media() {
|
_urpmi_media() {
|
||||||
local ret=1 single=0
|
|
||||||
local -a all_sources opts
|
|
||||||
|
|
||||||
if [[ $1 = -s ]]; then
|
|
||||||
single=1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO should we probe for active media only?
|
# TODO should we probe for active media only?
|
||||||
all_sources=( ${(f)"$(urpmq --list-media 2> /dev/null)"} )
|
compadd "$@" - ${(f)"$(urpmq --list-media 2> /dev/null)"}
|
||||||
|
|
||||||
if (( single )); then
|
|
||||||
compadd "$expl[@]" -a all_sources && ret=0
|
|
||||||
else
|
|
||||||
_values -s , 'urpmi media' "$all_sources[@]" && ret=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
return $ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_urpmi_rpms() {
|
_urpmi_rpms() {
|
||||||
|
@ -40,7 +24,7 @@ _urpmi_rpms() {
|
||||||
|
|
||||||
_requested files expl '(S)RPM file' \
|
_requested files expl '(S)RPM file' \
|
||||||
_files -g '*.(#i)rpm(-.)' && ret=0
|
_files -g '*.(#i)rpm(-.)' && ret=0
|
||||||
|
|
||||||
(( ret )) || break
|
(( ret )) || break
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -65,12 +49,12 @@ _urpmi_media_url() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
_urpme_package() {
|
_urpme_package() {
|
||||||
local -a _rpms
|
local -a _rpms
|
||||||
_rpms=( $(_call_program packages rpm -qa 2>/dev/null) )
|
_rpms=( $(_call_program packages rpm -qa) )
|
||||||
compadd "$@" -a _rpms
|
compadd "$@" -a _rpms
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,12 +64,11 @@ _urpmi_parallel_alias() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_urpmi() {
|
_urpmi() {
|
||||||
local state context line ret=1 help="--help -h"
|
local ret=1 help="--help -h"
|
||||||
|
local -a opts_help opts_net opts_verbose opts_inst_rem opts_search opts_media
|
||||||
local -a opts_help opts_net opts_verbose opts_inst_rem opts_search opts_media
|
|
||||||
|
|
||||||
opts_help=(
|
opts_help=(
|
||||||
"($help : -)"{--help,-h}"[print usage information]"
|
"(: -)"{--help,-h}"[print usage information]"
|
||||||
)
|
)
|
||||||
|
|
||||||
opts_net=(
|
opts_net=(
|
||||||
|
@ -116,10 +99,10 @@ _urpmi() {
|
||||||
)
|
)
|
||||||
|
|
||||||
opts_media=(
|
opts_media=(
|
||||||
"($help)--excludemedia[do not use the given media]:urpmi media: _urpmi_media"
|
"($help)--excludemedia[do not use the given media]:urpmi media:_sequence _urpmi_media"
|
||||||
"($help --update --use-distrib)--media[use only the media listed by comma]:urpmi media: _urpmi_media"
|
"($help --update --use-distrib)--media[use only the media listed by comma]:urpmi media:_sequence _urpmi_media"
|
||||||
"($help)--searchmedia[use only the given media to search requested (or updated) packages]:urpmi media: _urpmi_media -s"
|
"($help)--searchmedia[use only the given media to search requested (or updated) packages]:urpmi media:_urpmi_media"
|
||||||
"($help)--sortmedia[sort media according to substrings separated by comma]:urpmi media: _urpmi_media"
|
"($help)--sortmedia[sort media according to substrings separated by comma]:urpmi media:_sequence _urpmi_media"
|
||||||
"($help)--synthesis[use the given synthesis instead of urpmi db]:synthesis file:_url"
|
"($help)--synthesis[use the given synthesis instead of urpmi db]:synthesis file:_url"
|
||||||
"($help --media --use-distrib)--update[use only update media]"
|
"($help --media --use-distrib)--update[use only update media]"
|
||||||
"($help --media --update)--use-distrib[configure urpmi on the fly from a distrib tree]:installation media:_urpmi_media_url"
|
"($help --media --update)--use-distrib[configure urpmi on the fly from a distrib tree]:installation media:_urpmi_media_url"
|
||||||
|
@ -132,7 +115,7 @@ _urpmi() {
|
||||||
$opts_inst_rem \
|
$opts_inst_rem \
|
||||||
"--auto[do not ask any question]" \
|
"--auto[do not ask any question]" \
|
||||||
"-v[verbose]" \
|
"-v[verbose]" \
|
||||||
": :_urpme_package"
|
": :_urpme_package" && ret=0
|
||||||
;;
|
;;
|
||||||
urpmi.addmedia )
|
urpmi.addmedia )
|
||||||
_arguments -A '-*' \
|
_arguments -A '-*' \
|
||||||
|
@ -165,7 +148,7 @@ _urpmi() {
|
||||||
"($help :)-a[select all media]" \
|
"($help :)-a[select all media]" \
|
||||||
"($help)-c[clean headers cache directory]" \
|
"($help)-c[clean headers cache directory]" \
|
||||||
"($help)-y[fuzzy mathing on media names]" \
|
"($help)-y[fuzzy mathing on media names]" \
|
||||||
"(-a)"{,\*}": : _urpmi_media" \
|
"(-a)"{,\*}":media:_sequence _urpmi_media" \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
urpmi.update )
|
urpmi.update )
|
||||||
|
@ -179,7 +162,7 @@ _urpmi() {
|
||||||
"($help --update :)-a[select all non-removable media]" \
|
"($help --update :)-a[select all non-removable media]" \
|
||||||
"($help)-c[clean /var/cache/urpmi/headers on exit]" \
|
"($help)-c[clean /var/cache/urpmi/headers on exit]" \
|
||||||
"($help)*-f[force generation of hdlist files]" \
|
"($help)*-f[force generation of hdlist files]" \
|
||||||
"($help -a)"{,\*}": : _urpmi_media" \
|
"($help -a)"{,\*}":media:_sequence _urpmi_media" \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
urpmi )
|
urpmi )
|
||||||
|
@ -308,7 +291,7 @@ _urpmi() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return $ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
_urpmi "$@"
|
_urpmi "$@"
|
||||||
|
|
|
@ -122,7 +122,7 @@ _rpm () {
|
||||||
query)
|
query)
|
||||||
# --dump requires one of -{l,c,d}
|
# --dump requires one of -{l,c,d}
|
||||||
# --triggers requires --script
|
# --triggers requires --script
|
||||||
_arguments -s \
|
_arguments -s -C \
|
||||||
\!{-q,--query} "${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
|
\!{-q,--query} "${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
|
||||||
"($sopts)--specfile[query specified spec file as if it were a package]" \
|
"($sopts)--specfile[query specified spec file as if it were a package]" \
|
||||||
'(-i --info)'{-i,--info}'[display package information]' \
|
'(-i --info)'{-i,--info}'[display package information]' \
|
||||||
|
@ -140,10 +140,10 @@ _rpm () {
|
||||||
{--triggers,--triggerscripts}'[show trigger scripts]' && ret=0
|
{--triggers,--triggerscripts}'[show trigger scripts]' && ret=0
|
||||||
;;
|
;;
|
||||||
setattrs)
|
setattrs)
|
||||||
_arguments -s --set{perm,ugids} "${selectopts[@]}" && ret = 0
|
_arguments -s -C --set{perm,ugids} "${selectopts[@]}" && ret=0
|
||||||
;;
|
;;
|
||||||
verify)
|
verify)
|
||||||
_arguments -s \!-{y,V} \
|
_arguments -s -C \!-{y,V} \
|
||||||
"${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
|
"${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
|
||||||
--no{deps,files,scripts,digest,signature,linkto,md5,size,user,group,mtime,mode,rdev} && ret=0
|
--no{deps,files,scripts,digest,signature,linkto,md5,size,user,group,mtime,mode,rdev} && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -151,7 +151,7 @@ _rpm () {
|
||||||
tmp=( '(--force)--oldpackage' )
|
tmp=( '(--force)--oldpackage' )
|
||||||
;&
|
;&
|
||||||
install)
|
install)
|
||||||
_arguments -s \!-{i,U} "$tmp[@]" \
|
_arguments -s -C \!-{i,U} "$tmp[@]" \
|
||||||
"${commonopts[@]}" "${pathopts[@]}" \
|
"${commonopts[@]}" "${pathopts[@]}" \
|
||||||
'--excludepath:file to exclude:_files -/' \
|
'--excludepath:file to exclude:_files -/' \
|
||||||
'--relocate:relocate:->relocate' \
|
'--relocate:relocate:->relocate' \
|
||||||
|
@ -165,7 +165,7 @@ _rpm () {
|
||||||
'*:pkg file:->package_file' && ret=0
|
'*:pkg file:->package_file' && ret=0
|
||||||
;;
|
;;
|
||||||
uninstall)
|
uninstall)
|
||||||
_arguments -s \!-e \
|
_arguments -s -C \!-e \
|
||||||
"${commonopts[@]}" "${pathopts[@]}" \
|
"${commonopts[@]}" "${pathopts[@]}" \
|
||||||
--{allmatches,justdb,repackage,test} \
|
--{allmatches,justdb,repackage,test} \
|
||||||
--no{deps,scripts,preun,postun,trigger{s,un,postun}} \
|
--no{deps,scripts,preun,postun,trigger{s,un,postun}} \
|
||||||
|
@ -177,7 +177,7 @@ _rpm () {
|
||||||
build_t)
|
build_t)
|
||||||
(( $#tmp )) || tmp=( '*:tar file:_files -g "*.(#i)tar(.*|)(-.)"' )
|
(( $#tmp )) || tmp=( '*:tar file:_files -g "*.(#i)tar(.*|)(-.)"' )
|
||||||
|
|
||||||
_arguments -s \
|
_arguments -s -C \
|
||||||
"${commonopts[@]}" "${pathopts[@]}" \
|
"${commonopts[@]}" "${pathopts[@]}" \
|
||||||
--{short-circuit,clean,nobuild,rmsource,sign,test} \
|
--{short-circuit,clean,nobuild,rmsource,sign,test} \
|
||||||
'--target:specify a build target:->target'\
|
'--target:specify a build target:->target'\
|
||||||
|
@ -187,13 +187,13 @@ _rpm () {
|
||||||
'--timecheck:time check (seconds):' "$tmp[1]" && ret=0
|
'--timecheck:time check (seconds):' "$tmp[1]" && ret=0
|
||||||
;;
|
;;
|
||||||
sigcheck)
|
sigcheck)
|
||||||
_arguments -s \!-K \
|
_arguments -s -C \!-K \
|
||||||
"${commonopts[@]}" \
|
"${commonopts[@]}" \
|
||||||
--no{gpg,pgp,md5,signature,digest} \
|
--no{gpg,pgp,md5,signature,digest} \
|
||||||
'*:package file:->package_file' && ret=0
|
'*:package file:->package_file' && ret=0
|
||||||
;;
|
;;
|
||||||
rebuild)
|
rebuild)
|
||||||
_arguments -s \
|
_arguments -s -C \
|
||||||
"${commonopts[@]}" "${pathopts[@]}" \
|
"${commonopts[@]}" "${pathopts[@]}" \
|
||||||
'*:source package file:->package_file' && ret=0
|
'*:source package file:->package_file' && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -286,7 +286,7 @@ _rpm () {
|
||||||
;;
|
;;
|
||||||
capabilities)
|
capabilities)
|
||||||
_wanted capabilities expl capability compadd \
|
_wanted capabilities expl capability compadd \
|
||||||
${(f)"$(_call_program capabilities rpm -qa --queryformat '%\{requirename}\\n' 2>/dev/null)"}
|
${(f)"$(_call_program capabilities rpm -qa --queryformat '%\{requirename}\\n' 2>/dev/null)"} && ret=0
|
||||||
;;
|
;;
|
||||||
relocate)
|
relocate)
|
||||||
if compset -P '*='; then
|
if compset -P '*='; then
|
||||||
|
|
|
@ -1,23 +1,7 @@
|
||||||
#compdef ptree
|
#compdef ptree
|
||||||
|
|
||||||
_ptree() {
|
_arguments -s \
|
||||||
local curcontext="$curcontext" context state line ret=1
|
'-a[all processes]' \
|
||||||
typeset -A opt_args
|
'-c[show contract memberships]' \
|
||||||
|
'-z[show processes in zone]:zone:_zones' \
|
||||||
_arguments -s \
|
'*: : _alternative "users:logged-in user:_users_on" "pids:pid:_pids"'
|
||||||
'-a[all processes]' \
|
|
||||||
'-c[show contract memberships]' \
|
|
||||||
'-z[show processes in zone]:zone:($(zoneadm list))' \
|
|
||||||
'*:pid or user:->pidoruser' && ret=0
|
|
||||||
|
|
||||||
if [[ $ret -ne 0 ]]; then
|
|
||||||
_alternative \
|
|
||||||
'users:logged-in user:compadd ${$(who -q)\:#(users=*|\#)}' \
|
|
||||||
'pids:pid:_pids'
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
return $ret
|
|
||||||
}
|
|
||||||
|
|
||||||
_ptree "$@"
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef arp
|
#compdef arp
|
||||||
|
|
||||||
local state line expl curcontext="$curcontext"
|
local state line expl curcontext="$curcontext" ret=1
|
||||||
local -a cmds
|
local -a cmds
|
||||||
|
|
||||||
cmds=(-a --display -d --delete -s --set -f --file)
|
cmds=(-a --display -d --delete -s --set -f --file)
|
||||||
|
@ -15,7 +15,9 @@ _arguments -C \
|
||||||
'(-H --hw-type -d --delete)'{-H,--hw-type}'[class of entries to check for]:class:(ether arcnet pronet ax25 netrom)' \
|
'(-H --hw-type -d --delete)'{-H,--hw-type}'[class of entries to check for]:class:(ether arcnet pronet ax25 netrom)' \
|
||||||
'(-n --numeric -d --delete -s --set -f --file)'{-n,--numeric}'[shows numerical addresses]' \
|
'(-n --numeric -d --delete -s --set -f --file)'{-n,--numeric}'[shows numerical addresses]' \
|
||||||
'(-v --verbose)'{-v,--verbose}'[be verbose]' \
|
'(-v --verbose)'{-v,--verbose}'[be verbose]' \
|
||||||
'(-a)1:host:->hostintable'
|
'(-a)1:host:->hostintable' && ret=0
|
||||||
|
|
||||||
[[ "$state" = hostintable ]] &&
|
[[ "$state" = hostintable ]] &&
|
||||||
_wanted hosts expl 'host' compadd ${${${(f)"$(${words[1]} -an)"}##[ ?(]#}%%[ )]*}
|
_wanted hosts expl 'host' compadd ${${${(f)"$(${words[1]} -an)"}##[ ?(]#}%%[ )]*} && ret=0
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef atrm atq at batch
|
#compdef atrm atq at batch
|
||||||
|
|
||||||
local context state line expl
|
local context state line expl ret=1
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
#todo (when extremely bored) make -l and -d do the atq and atrm completions
|
#todo (when extremely bored) make -l and -d do the atq and atrm completions
|
||||||
|
@ -8,12 +8,12 @@ case $service in
|
||||||
atrm)
|
atrm)
|
||||||
_arguments \
|
_arguments \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'*:job number:->jobs'
|
'*:job number:->jobs' && ret=0
|
||||||
;;
|
;;
|
||||||
atq)
|
atq)
|
||||||
_arguments \
|
_arguments \
|
||||||
'-V[print version number]' \
|
'-V[print version number]' \
|
||||||
'-q[uses specified queue]:a-z+A-Z'
|
'-q[uses specified queue]:a-z+A-Z' && ret=0
|
||||||
;;
|
;;
|
||||||
at|batch)
|
at|batch)
|
||||||
_arguments \
|
_arguments \
|
||||||
|
@ -29,11 +29,13 @@ at|batch)
|
||||||
- atrm \
|
- atrm \
|
||||||
'-d[alias for atrm]' \
|
'-d[alias for atrm]' \
|
||||||
- show-job \
|
- show-job \
|
||||||
'-c[cat specified jobs to stdout]:*:job number:->jobs'
|
'-c[cat specified jobs to stdout]:*:job number:->jobs' && ret=0
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
jobs)
|
jobs)
|
||||||
_wanted job expl 'job number' compadd ${(M)${(f)"$(_call_program job atq)"}##<->}
|
_wanted -C $context jobs expl 'job number' compadd ${(M)${(f)"$(_call_program job atq)"}##<->} && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -21,7 +21,7 @@ case $service in
|
||||||
;&
|
;&
|
||||||
btlaunchmanycurses)
|
btlaunchmanycurses)
|
||||||
_arguments -s -S \
|
_arguments -s -S \
|
||||||
'(--responsefile)--responsefile+[specify file for server response]:file:_files -g "*"'\
|
'(--responsefile)--responsefile+[specify file for server response]:file:_files'\
|
||||||
"--url+[specify URL of torrent file]:URL:_urls"\
|
"--url+[specify URL of torrent file]:URL:_urls"\
|
||||||
'(-i --ip)'{-i+,--ip+}'[specify ip address to report as]:ip address'\
|
'(-i --ip)'{-i+,--ip+}'[specify ip address to report as]:ip address'\
|
||||||
"--bind+[specify ip to bind to instead of default]:ip:_bind_addresses"\
|
"--bind+[specify ip to bind to instead of default]:ip:_bind_addresses"\
|
||||||
|
@ -50,18 +50,18 @@ case $service in
|
||||||
"--max_initiate+[specify peers needed before stopping initiating new connections]:peers:"\
|
"--max_initiate+[specify peers needed before stopping initiating new connections]:peers:"\
|
||||||
"--report_hash_failures+[report hash failures to user]:enable:(0 1)"\
|
"--report_hash_failures+[report hash failures to user]:enable:(0 1)"\
|
||||||
"--rarest_first_priority_cutoff+[specify peers which need to have a piece before other partials take priority over rarest first]:peers:"\
|
"--rarest_first_priority_cutoff+[specify peers which need to have a piece before other partials take priority over rarest first]:peers:"\
|
||||||
':torrent file:_files -g "*.torrent(-.)"' \
|
':torrent file:_files -g "*.torrent(-.)"'
|
||||||
&& return 0
|
return
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Next up are the torrent file manipulation programs.
|
# Next up are the torrent file manipulation programs.
|
||||||
|
|
||||||
btshowmetainfo)
|
btshowmetainfo)
|
||||||
_files -g "*.torrent(-.)" && return 0
|
_files -g "*.torrent(-.)" && return
|
||||||
;;
|
;;
|
||||||
|
|
||||||
btrename)
|
btrename)
|
||||||
_files -g '*.torrent(-.)' && return 0
|
_files -g '*.torrent(-.)' && return
|
||||||
;;
|
;;
|
||||||
|
|
||||||
btmakemetafile)
|
btmakemetafile)
|
||||||
|
@ -69,12 +69,12 @@ case $service in
|
||||||
'--piece_size_pow2+[specify power of 2 to set the piece size to]:power:' \
|
'--piece_size_pow2+[specify power of 2 to set the piece size to]:power:' \
|
||||||
"--comment+[specify human-readable comment to put in .torrent]:comment:"\
|
"--comment+[specify human-readable comment to put in .torrent]:comment:"\
|
||||||
"--target+[specify target file for the torrent]:file:_files"\
|
"--target+[specify target file for the torrent]:file:_files"\
|
||||||
':file:_files -g "*"' \
|
':file:_files -g "*"'
|
||||||
&& return 0;
|
return
|
||||||
;;
|
;;
|
||||||
|
|
||||||
btreannounce)
|
btreannounce)
|
||||||
_files -g '*.torrent(-.)' && return 0
|
_files -g '*.torrent(-.)' && return
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Lastly the tracker.
|
# Lastly the tracker.
|
||||||
|
@ -94,7 +94,7 @@ case $service in
|
||||||
"--min_time_between_log_flushes+[specify minimum time between log flushes]:time (s):" \
|
"--min_time_between_log_flushes+[specify minimum time between log flushes]:time (s):" \
|
||||||
"--allowed_dir+[specify directory having downloadable torrents]:directory:_files -/" \
|
"--allowed_dir+[specify directory having downloadable torrents]:directory:_files -/" \
|
||||||
"--parse_allowed_interval+[specify interval between reloading allowed_dir]:time (min):" \
|
"--parse_allowed_interval+[specify interval between reloading allowed_dir]:time (min):" \
|
||||||
"--show_names+[display names from allowed dir]:enable:(0 1)"\
|
"--show_names+[display names from allowed dir]:enable:(0 1)"
|
||||||
&& return 0
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#compdef bogoutil bogotune bogofilter
|
#compdef bogoutil bogotune bogofilter
|
||||||
|
|
||||||
local expl ret bogotokens
|
|
||||||
|
|
||||||
_bogoutil_caching_policy () {
|
_bogoutil_caching_policy () {
|
||||||
local -a oldp
|
local -a oldp
|
||||||
|
|
||||||
|
@ -14,6 +12,7 @@ _bogoutil_caching_policy () {
|
||||||
|
|
||||||
_bogoutil() {
|
_bogoutil() {
|
||||||
|
|
||||||
|
local bogotokens expl ret=1
|
||||||
typeset -a _bogoutil_actions
|
typeset -a _bogoutil_actions
|
||||||
_bogoutil_actions=(-h --help -V --version -d --dump -l --load -u
|
_bogoutil_actions=(-h --help -V --version -d --dump -l --load -u
|
||||||
--upgrade -m -w -p -H --db-verify -r -R --db-prune --db-recover
|
--upgrade -m -w -p -H --db-verify -r -R --db-prune --db-recover
|
||||||
|
@ -46,30 +45,27 @@ _bogoutil() {
|
||||||
"($_bogoutil_actions)"'--db-remove-environment:database:_files -/' \
|
"($_bogoutil_actions)"'--db-remove-environment:database:_files -/' \
|
||||||
'--db_lk_max_locks[set max lock count]' \
|
'--db_lk_max_locks[set max lock count]' \
|
||||||
'--db_lk_max_objects[set max object count]' \
|
'--db_lk_max_objects[set max object count]' \
|
||||||
"($_bogoutil_actions)"'-h[help]' \
|
"($_bogoutil_actions)"{-h,--help}'[help]' \
|
||||||
"($_bogoutil_actions)"'--help' \
|
"($_bogoutil_actions)"{-V,--version}'[version]' \
|
||||||
"($_bogoutil_actions)"'-V[version]' \
|
|
||||||
"($_bogoutil_actions)"'--version' \
|
|
||||||
'*:tokens:->tokens' && ret=0
|
'*:tokens:->tokens' && ret=0
|
||||||
|
|
||||||
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
|
||||||
if [[ -z "$update_policy" ]]; then
|
if [[ -z "$update_policy" ]]; then
|
||||||
zstyle ":completion:${curcontext}:" cache-policy _bogoutil_caching_policy
|
zstyle ":completion:${curcontext}:" cache-policy _bogoutil_caching_policy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(tokens)
|
(tokens)
|
||||||
if ( [[ -z "$bogotokens" ]] || _cache_invalid bogotokens ) &&
|
if ( [[ -z "$bogotokens" ]] || _cache_invalid bogotokens ) &&
|
||||||
! _retrieve_cache bogotokens; then
|
! _retrieve_cache bogotokens; then
|
||||||
bogotokens=(${${(f)"$(_call_program bogoutil bogoutil -d ~/.bogofilter/wordlist.db -c 50)"}%% *})
|
bogotokens=(${${(f)"$(_call_program bogotokens bogoutil -d ~/.bogofilter/wordlist.db -c 50)"}%% *})
|
||||||
_store_cache bogotokens bogotokens
|
_store_cache bogotokens bogotokens
|
||||||
else
|
|
||||||
:
|
|
||||||
fi
|
fi
|
||||||
_wanted tokens expl "token" \
|
_wanted tokens expl "token" compadd -a bogotokens && ret=0
|
||||||
compadd -a bogotokens
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
case $service in
|
case $service in
|
||||||
|
|
|
@ -13,10 +13,10 @@ all_opts=(
|
||||||
)
|
)
|
||||||
|
|
||||||
urwid_opts=(
|
urwid_opts=(
|
||||||
'(-r --reactor)'{-r,--reactor}'[use Twisted reactor instead of the event loop]:reactor:'
|
'(-r --reactor)'{-r,--reactor}'[use twisted reactor instead of the event loop]:reactor'
|
||||||
'--help-reactors[display list of available Twisted reactors]'
|
'--help-reactors[display list of available Twisted reactors]'
|
||||||
'(-p --plugin)'{-p,--plugin}'[exectue a twistd plugin]:plugin:'
|
'(-p --plugin)'{-p,--plugin}'[execute a twisted plugin]:plugin'
|
||||||
'(-s --server)'{-s,--server}'[run an eval server on the given port]:port:'
|
'(-s --server)'{-s,--server}'[run an eval server on the given port]:port:_ports'
|
||||||
)
|
)
|
||||||
|
|
||||||
gtk_opts=(
|
gtk_opts=(
|
||||||
|
@ -26,19 +26,19 @@ gtk_opts=(
|
||||||
case "$service" in
|
case "$service" in
|
||||||
bpython|bpython2|bpython3)
|
bpython|bpython2|bpython3)
|
||||||
_arguments \
|
_arguments \
|
||||||
"$all_opts[@]" && return 0
|
"$all_opts[@]"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
bpython-urwid|bpython2-urwid|bpython3-urwid)
|
bpython-urwid|bpython2-urwid|bpython3-urwid)
|
||||||
_arguments \
|
_arguments \
|
||||||
"$all_opts[@]" \
|
"$all_opts[@]" \
|
||||||
"$urwid_opts[@]" && return 0
|
"$urwid_opts[@]"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
bpython-gtk|bpython2-gtk|bpython3-gtk)
|
bpython-gtk|bpython2-gtk|bpython3-gtk)
|
||||||
_arguments \
|
_arguments \
|
||||||
"$all_opts[@]" \
|
"$all_opts[@]" \
|
||||||
"$gtk_opts[@]" && return 0
|
"$gtk_opts[@]"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,12 @@ _arguments -C \
|
||||||
|
|
||||||
if (( ! $+_bzr_cmds )); then
|
if (( ! $+_bzr_cmds )); then
|
||||||
typeset -gH _bzr_cmds
|
typeset -gH _bzr_cmds
|
||||||
_bzr_cmds=(${(f)"$(_call_program bzr bzr shell-complete)"})
|
_bzr_cmds=(${(f)"$(_call_program subcommands bzr shell-complete)"})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $state != 'args' ]]; then
|
if [[ $state != 'args' ]]; then
|
||||||
_describe -t subcommand 'subcommand' _bzr_cmds
|
_describe -t subcommands 'subcommand' _bzr_cmds
|
||||||
return 0
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd="$words[1]"
|
cmd="$words[1]"
|
||||||
|
@ -25,39 +25,35 @@ curcontext="${curcontext%:*:*}:bzr-$cmd:"
|
||||||
(( $+functions[_bzr_unknownFiles] )) ||
|
(( $+functions[_bzr_unknownFiles] )) ||
|
||||||
_bzr_unknownFiles() {
|
_bzr_unknownFiles() {
|
||||||
local fileList
|
local fileList
|
||||||
fileList=(${(ps:\0:)"$(bzr ls --null --unknown -R)"})
|
fileList=(${(ps:\0:)"$(_call_program files bzr ls --null --unknown -R)"})
|
||||||
compadd -af fileList
|
compadd -af fileList
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_bzr_unknownRoot] )) ||
|
(( $+functions[_bzr_unknownRoot] )) ||
|
||||||
_bzr_unknownRoot() {
|
_bzr_unknownRoot() {
|
||||||
local fileList
|
local -a fileList
|
||||||
fileList=(${(ps:\0:)"$(bzr ls --null --from-root --unknown)"})
|
fileList=(${(ps:\0:)"$(_call_program files bzr ls --null --from-root --unknown)"})
|
||||||
compadd -af fileList
|
compadd -af fileList
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_bzr_versionedFiles] )) ||
|
(( $+functions[_bzr_versionedFiles] )) ||
|
||||||
_bzr_versionedFiles() {
|
_bzr_versionedFiles() {
|
||||||
local fileList
|
local fileList
|
||||||
fileList=(${(ps:\0:)"$(bzr ls --null --versioned -R)"})
|
fileList=(${(ps:\0:)"$(_call_program files bzr ls --null --versioned -R)"})
|
||||||
compadd -af fileList
|
compadd -af fileList
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_bzr_modifiedFiles] )) ||
|
(( $+functions[_bzr_modifiedFiles] )) ||
|
||||||
_bzr_modifiedFiles() {
|
_bzr_modifiedFiles() {
|
||||||
local fileList
|
local fileList
|
||||||
fileList=(${(ps:\0:)"$(bzr status . --versioned --short | cut -b 5- | tr '\n' '\0')"})
|
fileList=(${(ps:\0:)"$(_call_program files bzr status . --versioned --short | cut -b 5- | tr '\n' '\0')"})
|
||||||
compadd -af fileList
|
compadd -af fileList
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_bzr_completeParents] )) ||
|
(( $+functions[_bzr_completeParents] )) ||
|
||||||
_bzr_completeParents() {
|
_bzr_completeParents() {
|
||||||
local parentFile=$(bzr root 2>/dev/null)/.bzr/branch/parent
|
local parentFile=$(_call_program parents bzr root)/.bzr/branch/parent
|
||||||
[[ -r $parentFile ]] && compadd -X "Completing parents" $(cat $parentFile)
|
[[ -r $parentFile ]] && _wanted parents expl parent compadd -- $(<$parentFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
args=( '(-)'{--help,-h}'[show help message]' )
|
args=( '(-)'{--help,-h}'[show help message]' )
|
||||||
|
@ -99,7 +95,7 @@ case $cmd in
|
||||||
'--lightweight[perform a lightweight checkout]'
|
'--lightweight[perform a lightweight checkout]'
|
||||||
'(-r --revision)'{--revision=,-r}'[the revision to get]:rev:'
|
'(-r --revision)'{--revision=,-r}'[the revision to get]:rev:'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(rename|move|mv)
|
(rename|move|mv)
|
||||||
|
@ -194,7 +190,7 @@ case $cmd in
|
||||||
'(-v --verbose)'{--verbose,-v}'[display more information]'
|
'(-v --verbose)'{--verbose,-v}'[display more information]'
|
||||||
'*:local repository:_files -/'
|
'*:local repository:_files -/'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(missing)
|
(missing)
|
||||||
|
@ -210,7 +206,7 @@ case $cmd in
|
||||||
'(-v --verbose)'{--verbose,-v}'[display more information]'
|
'(-v --verbose)'{--verbose,-v}'[display more information]'
|
||||||
'*:local repository:_files -/'
|
'*:local repository:_files -/'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(commit|checkin|ci)
|
(commit|checkin|ci)
|
||||||
|
@ -227,7 +223,7 @@ case $cmd in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(bind|break-lock|reconcile)
|
(bind|break-lock|reconcile)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(register-branch)
|
(register-branch)
|
||||||
|
@ -240,7 +236,7 @@ case $cmd in
|
||||||
'--link-bug=[the bug this branch fixes]:bug-ID:'
|
'--link-bug=[the bug this branch fixes]:bug-ID:'
|
||||||
'--product=[launchpad product short name to associate with the branch]:product:'
|
'--product=[launchpad product short name to associate with the branch]:product:'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(remerge)
|
(remerge)
|
||||||
|
@ -249,7 +245,7 @@ case $cmd in
|
||||||
'--reprocess[reprocess to reduce spurious conflicts]'
|
'--reprocess[reprocess to reduce spurious conflicts]'
|
||||||
'--show-base[show base revision text in conflicts]'
|
'--show-base[show base revision text in conflicts]'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(conflicts|added|deleted|modified|unknowns|directories|ignored|unbind|nick|revno|version)
|
(conflicts|added|deleted|modified|unknowns|directories|ignored|unbind|nick|revno|version)
|
||||||
|
@ -322,7 +318,7 @@ case $cmd in
|
||||||
'--show-base[show base revision text in conflicts]'
|
'--show-base[show base revision text in conflicts]'
|
||||||
'*:local repository:_files -/'
|
'*:local repository:_files -/'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(ls)
|
(ls)
|
||||||
|
@ -346,7 +342,7 @@ case $cmd in
|
||||||
'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
|
'(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]'
|
||||||
'*:local repository:_files -/'
|
'*:local repository:_files -/'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(help)
|
(help)
|
||||||
|
@ -355,8 +351,8 @@ case $cmd in
|
||||||
'*:subcmds:->cmds'
|
'*:subcmds:->cmds'
|
||||||
)
|
)
|
||||||
_arguments -s "$args[@]" && ret=0
|
_arguments -s "$args[@]" && ret=0
|
||||||
_describe -t subcommand 'subcommand' _bzr_cmds
|
_describe -t subcommands 'subcommand' _bzr_cmds && ret=0
|
||||||
return 0
|
return ret
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
|
@ -380,7 +376,7 @@ case $cmd in
|
||||||
'--remember[remember the specified location as a default]'
|
'--remember[remember the specified location as a default]'
|
||||||
'*:local repository:_files -/'
|
'*:local repository:_files -/'
|
||||||
)
|
)
|
||||||
_bzr_completeParents
|
_bzr_completeParents && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(clean-tree)
|
(clean-tree)
|
||||||
|
@ -409,10 +405,11 @@ case $cmd in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(*)
|
(*)
|
||||||
_message "unknown bzr command completion: $cmd"
|
_default
|
||||||
return 1
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
_arguments -s "$args[@]" && ret=0
|
_arguments -s "$args[@]" && ret=0
|
||||||
return $ret
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -4,108 +4,85 @@
|
||||||
|
|
||||||
# Command completion and main loop {{{1
|
# Command completion and main loop {{{1
|
||||||
|
|
||||||
_cdrdao_commands () {
|
|
||||||
local -a commands
|
|
||||||
|
|
||||||
commands=(
|
|
||||||
'show-toc:print out a summary of a TOC'
|
|
||||||
'read-toc:create a TOC file based on a CD'
|
|
||||||
'read-cd:create a TOC file and image file based on a CD'
|
|
||||||
'read-cddb:add CD-TEXT data from a CDDB server to a TOC'
|
|
||||||
'show-data:print out samples that would be written to CD'
|
|
||||||
'read-test:check if data described in a TOC can be read from a CD'
|
|
||||||
'disk-info:show information about a CD'
|
|
||||||
'msinfo:generate mkisofs command for creating multi-session CD'
|
|
||||||
'unlock:try to unlock a recorder after a failed run'
|
|
||||||
'blank:blank a CD-RW'
|
|
||||||
'simulate:simulate a write'
|
|
||||||
'write:write a CD based on a TOC'
|
|
||||||
'copy:copy a CD'
|
|
||||||
)
|
|
||||||
|
|
||||||
_describe -t commands 'cdrdao command' commands && ret=0
|
|
||||||
}
|
|
||||||
|
|
||||||
_cdrdao () {
|
_cdrdao () {
|
||||||
local curcontext=$curcontext ret=1
|
local ret=1
|
||||||
|
local -a commands
|
||||||
local context state line
|
if (( CURRENT == 2 )); then
|
||||||
typeset -A opt_args
|
commands=( ${${${(M)${(f)"$(_call_program subcommands cdrdao 2>&1)"}:# *}// #- /:}#??} )
|
||||||
_arguments \
|
_describe -t subcommands 'cdrdao command' commands && ret=0
|
||||||
':command:->command' \
|
else
|
||||||
'*::options:->options' && ret=0
|
local cmd="${words[2]}"
|
||||||
case $state in
|
local curcontext="${curcontext%:*:*}:cdrdao-$cmd:"
|
||||||
(command)
|
shift words
|
||||||
_cdrdao_commands
|
(( CURRENT-- ))
|
||||||
;;
|
if ! _call_function ret _cdrdao-$cmd; then
|
||||||
(options)
|
_default && ret=0
|
||||||
curcontext="${curcontext%:*:*}:cdrdao-$words[1]:"
|
fi
|
||||||
_call_function ret _cdrdao-$words[1]
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
# Common arguments {{{1
|
# Common arguments {{{1
|
||||||
|
|
||||||
declare -ga tmpfile_args
|
declare -ga _cdrdao_tmpfile_args
|
||||||
tmpfile_args=(
|
_cdrdao_tmpfile_args=(
|
||||||
'--tmpdir[directory to store temporary data in]:directory:_directories'
|
'--tmpdir[directory to store temporary data in]:directory:_directories'
|
||||||
'--keep[do not remove temporary data when done]')
|
'--keep[do not remove temporary data when done]'
|
||||||
|
)
|
||||||
declare -ga device_args
|
|
||||||
device_args=(
|
|
||||||
'--device[set SCSI address of the CD recorder]:device:__cdrdao-device'
|
|
||||||
'--driver[use given driver for the CD recorder]:driver:__cdrdao-drivers')
|
|
||||||
|
|
||||||
# TODO: Gah! Fix a cddb server spec matcher
|
# TODO: Gah! Fix a cddb server spec matcher
|
||||||
declare -ga cddb_args
|
declare -ga _cdrdao_cddb_args
|
||||||
cddb_args=(
|
_cdrdao_cddb_args=(
|
||||||
'--cddb-servers[specify list of CDDB servers to use]:CDDB servers:'
|
'--cddb-servers[specify list of CDDB servers to use]:CDDB servers:'
|
||||||
'--cddb-timeout[specify timeout in seconds for connections to CDDB servers]: :_guard "[[\:digit\:]]" timeout'
|
'--cddb-timeout[specify timeout in seconds for connections to CDDB servers]: :_guard "[[\:digit\:]]" timeout'
|
||||||
'--cddb-directory[directory where fetched CDDB records will be stored]:directory:_directories')
|
'--cddb-directory[directory where fetched CDDB records will be stored]:directory:_directories'
|
||||||
|
)
|
||||||
|
|
||||||
declare -g paranoiamode_arg=
|
declare -g _cdrdao_paranoiamode_arg
|
||||||
paranoiamode_arg='--paranoia-mode[set correction mode for digital audio extraction]:mode:(("0\:no checking" "1\:perform overlapped reading to avoid jitter" "2\:like 1 but with checks of read audio data" "3\:like 2 but with scratch detection/repair (default)"))'
|
_cdrdao_paranoiamode_arg='--paranoia-mode[set correction mode for digital audio extraction]:mode:(("0\:no checking" "1\:perform overlapped reading to avoid jitter" "2\:like 1 but with checks of read audio data" "3\:like 2 but with scratch detection/repair (default)"))'
|
||||||
|
|
||||||
declare -g fasttoc_arg=
|
declare -g _cdrdao_fasttoc_arg
|
||||||
fasttoc_arg='--fast-toc[skip pre-gap-length and index-mark extraction]'
|
_cdrdao_fasttoc_arg='--fast-toc[skip pre-gap-length and index-mark extraction]'
|
||||||
|
|
||||||
declare -g swap_arg=
|
declare -g _cdrdao_swap_arg
|
||||||
swap_arg='--swap[swap the byte order of samples]'
|
_cdrdao_swap_arg='--swap[swap the byte order of samples]'
|
||||||
|
|
||||||
declare -g reload_arg=
|
declare -g _cdrdao_reload_arg
|
||||||
reload_arg='--reload[reload the disk if necessary]'
|
_cdrdao_reload_arg='--reload[reload the disk if necessary]'
|
||||||
|
|
||||||
declare -g eject_arg=
|
declare -g _cdrdao_eject_arg
|
||||||
eject_arg='--eject[eject CD after completed operation]'
|
_cdrdao_eject_arg='--eject[eject CD after completed operation]'
|
||||||
|
|
||||||
declare -g speed_arg=
|
declare -g _cdrdao_speed_arg
|
||||||
speed_arg='-speed[set writing speed]: :_guard "[[\:digit\:]]##" speed'
|
_cdrdao_speed_arg='-speed[set writing speed]: :_guard "[[\:digit\:]]##" speed'
|
||||||
|
|
||||||
declare -ga common_args
|
declare -ga _cdrdao_common_args
|
||||||
common_args=(
|
_cdrdao_common_args=(
|
||||||
'(*)'{-h,--help}'[display command/option summary]'
|
'(*)'{-h,--help}'[display command/option summary]'
|
||||||
'-v[set verbosity level]: :_guard "[[\:digit\:]]##" verbosity')
|
'-v[set verbosity level]: :_guard "[[\:digit\:]]##" verbosity')
|
||||||
|
|
||||||
declare -ga common_toc_args
|
declare -ga _cdrdao_common_toc_args
|
||||||
common_toc_args=(
|
_cdrdao_common_toc_args=(
|
||||||
$common_args
|
$_cdrdao_common_args
|
||||||
':TOC file:_files -g "*.toc(-.)"')
|
':TOC file:_files -g "*.toc(-.)"')
|
||||||
|
|
||||||
declare -ga common_device_args
|
declare -ga _cdrdao_common_device_args
|
||||||
common_device_args=(
|
_cdrdao_common_device_args=(
|
||||||
$common_args
|
$_cdrdao_common_args
|
||||||
$device_args)
|
'--device[set SCSI address of the CD recorder]:device:__cdrdao-device'
|
||||||
|
'--driver[use given driver for the CD recorder]:driver:__cdrdao-drivers'
|
||||||
|
)
|
||||||
|
|
||||||
declare -ga common_toc_device_args
|
declare -ga _cdrdao_common_toc_device_args
|
||||||
common_toc_device_args=(
|
_cdrdao_common_toc_device_args=(
|
||||||
$common_toc_args
|
$_cdrdao_common_toc_args
|
||||||
$common_device_args
|
$_cdrdao_common_device_args
|
||||||
$force_arg)
|
'--force[force execution of operation]'
|
||||||
|
)
|
||||||
|
|
||||||
declare -ga common_read_args
|
declare -ga _cdrdao_common_read_args
|
||||||
common_read_args=(
|
_cdrdao_common_read_args=(
|
||||||
'--rspeed[set reading speed]: :_guard "[[\:digit\:]]##" speed'
|
'--rspeed[set reading speed]: :_guard "[[\:digit\:]]##" speed'
|
||||||
'--session[specify what session to process on multi-session CDs]: :_guard "[[\:digit\:]]##" "session number"'
|
'--session[specify what session to process on multi-session CDs]: :_guard "[[\:digit\:]]##" "session number"'
|
||||||
'--read-subchan[set sub-channel reading-mode]:mode:(("rw\:de-interleaved and error corrected" "rw_raw\:not de-interleaved, not error-corrected, and L-EC data included"))'
|
'--read-subchan[set sub-channel reading-mode]:mode:(("rw\:de-interleaved and error corrected" "rw_raw\:not de-interleaved, not error-corrected, and L-EC data included"))'
|
||||||
|
@ -128,18 +105,18 @@ _cdrdao-toc-size () {
|
||||||
|
|
||||||
__cdrdao-show-toc-or-toc-info-or-toc-size () {
|
__cdrdao-show-toc-or-toc-info-or-toc-size () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_args \
|
$_cdrdao_common_toc_args \
|
||||||
$tmpfile_args && ret=0
|
$_cdrdao_tmpfile_args
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-read-toc () {
|
_cdrdao-read-toc () {
|
||||||
__cdrdao-read-toc-or-read-cd \
|
__cdrdao-read-toc-or-read-cd $_cdrdao_cddb_args
|
||||||
$fasttoc_arg
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-read-cd () {
|
_cdrdao-read-cd () {
|
||||||
__cdrdao-read-toc-or-read-cd \
|
__cdrdao-read-toc-or-read-cd \
|
||||||
$paranoiamode_arg
|
$_cdrdao_paranoiamode_arg \
|
||||||
|
$_cdrdao_cddb_args
|
||||||
}
|
}
|
||||||
|
|
||||||
__cdrdao-read-toc-or-read-cd () {
|
__cdrdao-read-toc-or-read-cd () {
|
||||||
|
@ -148,30 +125,31 @@ __cdrdao-read-toc-or-read-cd () {
|
||||||
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
|
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_device_args \
|
$_cdrdao_common_toc_device_args \
|
||||||
$common_read_args \
|
$_cdrdao_common_read_args \
|
||||||
$dependent_args
|
$dependent_args \
|
||||||
|
$_cdrdao_fasttoc_arg \
|
||||||
'--datafile[set name of data file placed in TOC file]:file:_files' \
|
'--datafile[set name of data file placed in TOC file]:file:_files' \
|
||||||
'--read-raw[read data in raw format from CD]' \
|
'--read-raw[read data in raw format from CD]' \
|
||||||
'--no-mode2-mixed[if MODE2_FORM1 or MODE2_FORM2, do not extract as MODE2_FORM_MIX]' \
|
'--no-mode2-mixed[if MODE2_FORM1 or MODE2_FORM2, do not extract as MODE2_FORM_MIX]' \
|
||||||
$* && ret=0
|
"$@" && ret=0
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-read-cddb () {
|
_cdrdao-read-cddb () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_args \
|
$_cdrdao_common_toc_args \
|
||||||
$cddb_args && ret=0
|
$_cdrdao_cddb_args
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-show-data () {
|
_cdrdao-show-data () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_args \
|
$_cdrdao_common_toc_args \
|
||||||
$swap_arg && ret=0
|
$_cdrdao_swap_arg
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-read-test () {
|
_cdrdao-read-test () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_args && ret=0
|
$_cdrdao_common_toc_args
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-disk-info () {
|
_cdrdao-disk-info () {
|
||||||
|
@ -180,13 +158,18 @@ _cdrdao-disk-info () {
|
||||||
|
|
||||||
__cdrdao-disk-info-or-drive-info () {
|
__cdrdao-disk-info-or-drive-info () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_device_args && ret=0
|
$_cdrdao_common_device_args
|
||||||
|
}
|
||||||
|
|
||||||
|
_cdrdao-discid() {
|
||||||
|
_arguments $_cdrdao_common_device_args $_cdrdao_cddb_args \
|
||||||
|
'--query-string[print out CDDB query only]'
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-msinfo () {
|
_cdrdao-msinfo () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_device_args \
|
$_cdrdao_common_device_args \
|
||||||
$reload_arg && ret=0
|
$_cdrdao_reload_arg
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-drive-info () {
|
_cdrdao-drive-info () {
|
||||||
|
@ -195,22 +178,22 @@ _cdrdao-drive-info () {
|
||||||
|
|
||||||
_cdrdao-unlock () {
|
_cdrdao-unlock () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_device_args \
|
$_cdrdao_common_device_args \
|
||||||
$reload_arg \
|
$_cdrdao_reload_arg \
|
||||||
$eject_arg && ret=0
|
$_cdrdao_eject_arg
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-blank () {
|
_cdrdao-blank () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_device_args \
|
$_cdrdao_common_device_args \
|
||||||
$speed_arg \
|
$_cdrdao_speed_arg \
|
||||||
'--blank-mode[set the blanking mode]:blanking mode:(("full\:completely erase data" "minimal\:only dereference data"))' \
|
'--blank-mode[set the blanking mode]:blanking mode:(("full\:completely erase data" "minimal\:only dereference data"))' \
|
||||||
$eject_arg && ret=0
|
$_cdrdao_eject_arg
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-scanbus () {
|
_cdrdao-scanbus () {
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_args && ret=0
|
$_cdrdao_common_args
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-simulate () {
|
_cdrdao-simulate () {
|
||||||
|
@ -218,26 +201,26 @@ _cdrdao-simulate () {
|
||||||
}
|
}
|
||||||
|
|
||||||
__cdrdao-simulate-or-write () {
|
__cdrdao-simulate-or-write () {
|
||||||
local capacity_arg=
|
local _cdrdao_capacity_arg=
|
||||||
|
|
||||||
if (( $words[(I)--full-burn] )); then
|
if (( $words[(I)--full-burn] )); then
|
||||||
capacity_arg='--capacity[set disk capacity for --full-burn]: :_guard "[[\:digit\:]]" minutes'
|
_cdrdao_capacity_arg='--capacity[set disk capacity for --full-burn]: :_guard "[[\:digit\:]]" minutes'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
$common_toc_device_args \
|
$_cdrdao_common_toc_device_args \
|
||||||
$speed_arg \
|
$_cdrdao_speed_arg \
|
||||||
'--multi[do not close the session after successful write]' \
|
'--multi[do not close the session after successful write]' \
|
||||||
'--overburn[allow overburing of medium]' \
|
'--overburn[allow overburing of medium]' \
|
||||||
'--full-burn[force burning to the outer disk edge]' \
|
'--full-burn[force burning to the outer disk edge]' \
|
||||||
$capacity_arg \
|
$_cdrdao_capacity_arg \
|
||||||
$eject_arg \
|
$_cdrdao_eject_arg \
|
||||||
$swap_arg \
|
$_cdrdao_swap_arg \
|
||||||
'--buffers[set fifo buffer size]: :_guard "[[\:digit\:]]" size' \
|
'--buffers[set fifo buffer size]: :_guard "[[\:digit\:]]" size' \
|
||||||
$reload_arg \
|
$_cdrdao_reload_arg \
|
||||||
$tmpfile_args \
|
$_cdrdao_tmpfile_args \
|
||||||
'-n[do not pause before writing]' \
|
'-n[do not pause before writing]' \
|
||||||
$* && ret=0
|
$*
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-write () {
|
_cdrdao-write () {
|
||||||
|
@ -254,24 +237,24 @@ __cdrdao-read-toc-or-read-cd-or-copy-dependent-args () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( words[(I)--with-cddb] )); then
|
if (( words[(I)--with-cddb] )); then
|
||||||
dependent_args+=$cddb_args
|
dependent_args+=$_cdrdao_cddb_args
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_cdrdao-copy () {
|
_cdrdao-copy () {
|
||||||
local -ga dependent_args
|
local -a dependent_args
|
||||||
|
|
||||||
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
|
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
|
||||||
|
|
||||||
_cdrdao-write \
|
_cdrdao-write \
|
||||||
$dependent_args
|
$dependent_args \
|
||||||
$common_read_args
|
$_cdrdao_common_read_args \
|
||||||
'--source-device[set SCSI address of the CD reader]:device:__cdrdao-device' \
|
'--source-device[set SCSI address of the CD reader]:device:__cdrdao-device' \
|
||||||
'--source-driver[use given driver for the CD reader]:driver:__cdrdao-drivers' \
|
'--source-driver[use given driver for the CD reader]:driver:__cdrdao-drivers' \
|
||||||
'--on-the-fly[perform on-the-fly copy of CD (no image created)]' \
|
'--on-the-fly[perform on-the-fly copy of CD (no image created)]' \
|
||||||
$fasttoc_arg \
|
$_cdrdao_fasttoc_arg \
|
||||||
'--keepimage[do not remove generated image when done]' \
|
'--keepimage[do not remove generated image when done]' \
|
||||||
$paranoiamode_arg && ret=0
|
$_cdrdao_paranoiamode_arg
|
||||||
}
|
}
|
||||||
|
|
||||||
# Type completion {{{1
|
# Type completion {{{1
|
||||||
|
@ -280,24 +263,21 @@ __cdrdao-device () {
|
||||||
# Use cdrdao scanbus and also check what OS we're running under and provide
|
# Use cdrdao scanbus and also check what OS we're running under and provide
|
||||||
# additional stuff, like devices (/dev/sg0)
|
# additional stuff, like devices (/dev/sg0)
|
||||||
local -a devices
|
local -a devices
|
||||||
|
devices=(${${(f)"$(_call_program devices cdrdao scanbus -v 0 2>&1)"}%% :*})
|
||||||
|
|
||||||
devices=(${(f)"$(_call_program devices cdrdao scanbus -v 0 2>/dev/null)"})
|
_wanted devices expl 'device' compadd -a devices
|
||||||
if (( ${#pipestatus:#0} > 0 )); then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
_wanted devices expl 'device' compadd - $devices
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__cdrdao-drivers () {
|
__cdrdao-drivers () {
|
||||||
local -a drivers
|
local suf
|
||||||
|
local -Ua drivers
|
||||||
drivers=(${(f)"$(_call_program drivers cut -d'|' -f4 /usr/share/cdrdao/drivers -s 2>/dev/null | sort -u)"})
|
drivers=(${(f)"$(_call_program drivers cut -d'\|' -f4 /usr/share/cdrdao/drivers -s)"})
|
||||||
if (( ${#pipestatus:#0} > 0 )); then
|
if compset -P \*:; then
|
||||||
return 1
|
_message -e options option
|
||||||
|
else
|
||||||
|
compset -S :\* || suf=-qS:
|
||||||
|
_wanted drivers expl 'driver' compadd $suf -a drivers
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted drivers expl 'driver' compadd -qS: - $drivers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}1
|
# }}}1
|
||||||
|
|
|
@ -49,7 +49,7 @@ case "$state" in
|
||||||
compset -P '*'
|
compset -P '*'
|
||||||
_alternative -O suf \
|
_alternative -O suf \
|
||||||
'who:who:((u\:user g\:group a\:all o\:others))' \
|
'who:who:((u\:user g\:group a\:all o\:others))' \
|
||||||
'operators:operator:(+ - =)'
|
'operators:operator:(+ - =)' && ret=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
files)
|
files)
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
#compdef cpio
|
#compdef cpio
|
||||||
|
|
||||||
local args ig curcontext="$curcontext" state line
|
local args ig curcontext="$curcontext" state line
|
||||||
local expl ret
|
local expl ret=1
|
||||||
local fmts='(bar bin odc newc crc tar ustar hpbin hpodc)'
|
local fmts='(bar bin odc newc crc tar ustar hpbin hpodc)'
|
||||||
|
|
||||||
_pick_variant -r ig gnu=GNU unix --version
|
_pick_variant -r ig gnu=GNU unix --version
|
||||||
|
|
||||||
if (( CURRENT == 2 )); then
|
if (( CURRENT == 2 )); then
|
||||||
# Complete arguments
|
# Complete arguments
|
||||||
args=('-o[create archive]' '-i[extract from archive]'
|
args=('-o[create archive]' '-i[extract from archive]'
|
||||||
'-p[run as filter on directory tree]')
|
'-p[run as filter on directory tree]')
|
||||||
[[ $ig = gnu ]] && args=($args '--create[create archive]'
|
[[ $ig = gnu ]] && args=($args '--create[create archive]'
|
||||||
'--extract[extract from archive]'
|
'--extract[extract from archive]'
|
||||||
'--pass-through[run as filter on directory tree]'
|
'--pass-through[run as filter on directory tree]'
|
||||||
'--help[show help text]' '--version[show version information]')
|
'--help[show help text]' '--version[show version information]')
|
||||||
else
|
else
|
||||||
|
@ -23,13 +23,13 @@ else
|
||||||
"--format=:format type:$fmts"
|
"--format=:format type:$fmts"
|
||||||
'--message=:message at end of volume:'
|
'--message=:message at end of volume:'
|
||||||
'--null' '--reset-access-time'
|
'--null' '--reset-access-time'
|
||||||
'--verbose' '--dot' '--append'
|
'--verbose' '--dot' '--append'
|
||||||
'--block-size=:block size in 512 byte units:'
|
'--block-size=:block size in 512 byte units:'
|
||||||
'--dereference'
|
'--dereference'
|
||||||
'--io-size=:block size in bytes'
|
'--io-size=:block size in bytes'
|
||||||
'--quiet' '--force-local' '--help' '--version')
|
'--quiet' '--force-local' '--help' '--version')
|
||||||
fi
|
fi
|
||||||
args=($args
|
args+=(
|
||||||
'-A[append files to archive]'
|
'-A[append files to archive]'
|
||||||
'-B[block size 5120 bytes with special file]'
|
'-B[block size 5120 bytes with special file]'
|
||||||
'-C[set block size per record]:block size in bytes:(8192)'
|
'-C[set block size per record]:block size in bytes:(8192)'
|
||||||
|
@ -44,10 +44,10 @@ else
|
||||||
if [[ $ig = gnu ]]; then
|
if [[ $ig = gnu ]]; then
|
||||||
args=('--file=:archive file:->afile'
|
args=('--file=:archive file:->afile'
|
||||||
"--format=:format type:$fmts"
|
"--format=:format type:$fmts"
|
||||||
'--make-directories' '--nonmatching'
|
'--make-directories' '--nonmatching'
|
||||||
'--preserve-modification-time' '--numeric'
|
'--preserve-modification-time' '--numeric'
|
||||||
'--rename' '--list' '--swap-bytes' '--swap-halfwords'
|
'--rename' '--list' '--swap-bytes' '--swap-halfwords'
|
||||||
'--dot' '--unconditional' '--verbose'
|
'--dot' '--unconditional' '--verbose'
|
||||||
'--block-size=:block size in 512 byte units:'
|
'--block-size=:block size in 512 byte units:'
|
||||||
'--swap-halfwords'
|
'--swap-halfwords'
|
||||||
'--io-size=:block size in bytes:'
|
'--io-size=:block size in bytes:'
|
||||||
|
@ -58,7 +58,7 @@ else
|
||||||
'--no-absolute-filenames' '--sparse' '--only-verify-crc'
|
'--no-absolute-filenames' '--sparse' '--only-verify-crc'
|
||||||
'--quiet' '--help' '--version')
|
'--quiet' '--help' '--version')
|
||||||
fi
|
fi
|
||||||
args=($args
|
args+=(
|
||||||
'-b[reverse bytes in word]'
|
'-b[reverse bytes in word]'
|
||||||
'-B[block size 5120 bytes with special file]'
|
'-B[block size 5120 bytes with special file]'
|
||||||
'-d[create directories as needed]'
|
'-d[create directories as needed]'
|
||||||
|
@ -87,7 +87,7 @@ else
|
||||||
'--owner=:user (and group) for files:->user'
|
'--owner=:user (and group) for files:->user'
|
||||||
'--no-preserve-owner' '--sparse' '--help' '--version')
|
'--no-preserve-owner' '--sparse' '--help' '--version')
|
||||||
fi
|
fi
|
||||||
args=($args
|
args+=(
|
||||||
'-d[create directories as needed]'
|
'-d[create directories as needed]'
|
||||||
'-l[link files instead of copying]'
|
'-l[link files instead of copying]'
|
||||||
'-L[follow symbolic links]'
|
'-L[follow symbolic links]'
|
||||||
|
@ -98,12 +98,11 @@ else
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
args=($args
|
args+=(
|
||||||
'-a[reset access time of input files]'
|
'-a[reset access time of input files]'
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ret=1
|
|
||||||
_arguments -C -s "$args[@]" && ret=0
|
_arguments -C -s "$args[@]" && ret=0
|
||||||
|
|
||||||
if [[ $state = afile ]]; then
|
if [[ $state = afile ]]; then
|
||||||
|
@ -121,12 +120,12 @@ if [[ $state = afile ]]; then
|
||||||
fi
|
fi
|
||||||
elif [[ $state = user ]]; then
|
elif [[ $state = user ]]; then
|
||||||
if compset -P '*[:.]'; then
|
if compset -P '*[:.]'; then
|
||||||
_groups
|
_groups && ret=0
|
||||||
else
|
else
|
||||||
local suf=.
|
local suf=.
|
||||||
[[ $OSTYPE = (solaris|hpux)* ]] && suf=:
|
[[ $OSTYPE = (solaris|hpux)* ]] && suf=:
|
||||||
compset -S '.*' && unset suf
|
compset -S '.*' && unset suf
|
||||||
_users -S "$suf" -q
|
_users -S "$suf" -q && ret=0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef df
|
#compdef df
|
||||||
|
|
||||||
local context state state_descr line args spec
|
local curcontext="$curcontext" state state_descr line args spec ret=1
|
||||||
local -A opt_args
|
local -A opt_args
|
||||||
|
|
||||||
if _pick_variant gnu=GNU unix --version; then
|
if _pick_variant gnu=GNU unix --version; then
|
||||||
|
@ -34,6 +34,7 @@ elif [[ "$OSTYPE" == (darwin|freebsd|dragonfly)* ]]; then
|
||||||
'(-b -g -H -h -k -m)-m[use 1024*1024-byte blocks]'
|
'(-b -g -H -h -k -m)-m[use 1024*1024-byte blocks]'
|
||||||
'-P[POSIX compliant output]'
|
'-P[POSIX compliant output]'
|
||||||
'-a[show all mount points]'
|
'-a[show all mount points]'
|
||||||
|
'-c[display a grand total]'
|
||||||
'-i[include inode usage statistics (default)]'
|
'-i[include inode usage statistics (default)]'
|
||||||
'-l[only display locally-mounted file systems]'
|
'-l[only display locally-mounted file systems]'
|
||||||
'-n[use previously obtained statistics]'
|
'-n[use previously obtained statistics]'
|
||||||
|
@ -44,7 +45,7 @@ elif [[ "$OSTYPE" == (darwin|freebsd|dragonfly)* ]]; then
|
||||||
(darwin*)
|
(darwin*)
|
||||||
args+=(
|
args+=(
|
||||||
"-T+$spec"
|
"-T+$spec"
|
||||||
# '-t[same as -T (obsolete)]:file system type:->fslist'
|
"!-t+$spec" # obsolete
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
(freebsd*|dragonfly*)
|
(freebsd*|dragonfly*)
|
||||||
|
@ -61,19 +62,15 @@ else
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_arguments -s -S : $args && return 0
|
_arguments -C -s -S : $args && ret=0
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
(fslist)
|
(fslist)
|
||||||
local -a fsys used pre disp expl
|
[[ ! -prefix *, ]] && ! compset -P 'no' &&
|
||||||
_file_systems -U -O fsys
|
_describe -t list-prefixes 'prefix to list' \
|
||||||
pre=$IPREFIX
|
'( no:exclude\ file\ system\ types\ in\ the\ list )' && ret=0
|
||||||
# offer 'no' only if at the beginning of the list
|
_sequence -s , _file_systems && ret=0
|
||||||
if ! compset -P '*,' && ! compset -P 'no'; then
|
|
||||||
disp=( 'no -- exclude file system types in the list' )
|
|
||||||
_wanted list-prefix expl 'prefix to list' compadd -d disp 'no'
|
|
||||||
fi
|
|
||||||
used=( ${(s:,:)${${IPREFIX#$pre}#no}} )
|
|
||||||
_wanted fsys-types expl "$state_descr" compadd -qS , -F used -a fsys
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -1,26 +1,23 @@
|
||||||
#compdef django-admin.py django-admin manage.py
|
#compdef django-admin.py django-admin manage.py
|
||||||
|
|
||||||
local ret=1 state
|
local curcontext="$curcontext" state line expl ret=1
|
||||||
|
|
||||||
if [ "$service" = "manage.py" ] && [ ! -x ./manage.py ]; then
|
if [[ "$service" = "manage.py" && ! -x ./manage.py ]]; then
|
||||||
return 0
|
_default
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -ga common_args
|
declare -ga common_args
|
||||||
common_args=(
|
common_args=(
|
||||||
'--help[display help information]'
|
'--help[display help information]'
|
||||||
'--version[display version information]'
|
'--version[display version information]'
|
||||||
'--pythonpath=[directory to add to the Python path]:directory:_directories'
|
'--pythonpath=[directory to add to the Python path]:directory:_directories -W / -P /'
|
||||||
'--settings=[Python path to settings module]:settings'
|
'--settings=[python path to settings module]:settings'
|
||||||
'--traceback[print traceback on exception]'
|
'--traceback[print traceback on exception]'
|
||||||
)
|
)
|
||||||
|
|
||||||
_directories () {
|
|
||||||
_wanted directories expl directory _path_files -/ "$@" -
|
|
||||||
}
|
|
||||||
|
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
_arguments \
|
_arguments -C \
|
||||||
$common_args \
|
$common_args \
|
||||||
':subcommand:->subcommand' \
|
':subcommand:->subcommand' \
|
||||||
'*::options:->options' && ret=0
|
'*::options:->options' && ret=0
|
||||||
|
@ -66,7 +63,7 @@ case $state in
|
||||||
subcommands+=($cmd)
|
subcommands+=($cmd)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
_describe -t subcommands 'django admin subcommand' subcommands && ret=0
|
_describe -t subcommands 'django admin subcommand' subcommands && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -101,8 +98,8 @@ case $state in
|
||||||
settings="${DJANGO_SETTINGS_MODULE}"
|
settings="${DJANGO_SETTINGS_MODULE}"
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted appname expl appname compadd - $(command \
|
_wanted appname expl appname compadd - $(command \
|
||||||
sed -n "/INSTALLED_APPS\s*=\s*(/,/)/p" ${settings} | \
|
sed -n "/INSTALLED_APPS\s*=\s*(/,/)/p" ${settings} | \
|
||||||
sed -n "s/^\s*'\(.*\.\)*\(.*\)'.*$/\2 /pg")
|
sed -n "s/^\s*'\(.*\.\)*\(.*\)'.*$/\2 /pg")
|
||||||
|
@ -205,7 +202,7 @@ case $state in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
_arguments $args && ret=0
|
_arguments -C $args && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -5262,12 +5262,10 @@ __git_gpg_secret_keys () {
|
||||||
(( $+functions[__git_merge_strategies] )) ||
|
(( $+functions[__git_merge_strategies] )) ||
|
||||||
__git_merge_strategies () {
|
__git_merge_strategies () {
|
||||||
local expl
|
local expl
|
||||||
local -a merge_strategies
|
|
||||||
|
|
||||||
merge_strategies=(${=${${(M)${(f)"$(_call_program merge-strategies "git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.})
|
_wanted merge-strategies expl 'merge strategy' compadd "$@" - \
|
||||||
__git_command_successful $pipestatus || return 1
|
${=${${${(M)${(f)"$(_call_program merge-strategies \
|
||||||
|
"git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}:-octopus ours recursive resolve subtree}
|
||||||
_wanted merge-strategies expl 'merge strategy' compadd $* - $merge_strategies
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_encodings] )) ||
|
(( $+functions[__git_encodings] )) ||
|
||||||
|
@ -5299,8 +5297,9 @@ __git_remotes () {
|
||||||
local remotes expl
|
local remotes expl
|
||||||
|
|
||||||
remotes=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
|
remotes=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
|
||||||
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted remotes expl remote compadd $* - $remotes
|
_wanted remotes expl remote compadd "$@" -a - remotes
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_ref_specs] )) ||
|
(( $+functions[__git_ref_specs] )) ||
|
||||||
|
@ -5431,13 +5430,7 @@ __git_reflog_entries () {
|
||||||
reflog_entries=(${${${(f)"$(_call_program reflog-entries git reflog 2>/dev/null)"}#* }%%:*})
|
reflog_entries=(${${${(f)"$(_call_program reflog-entries git reflog 2>/dev/null)"}#* }%%:*})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
if compset -P '*@'; then
|
_wanted reflog-entries expl 'reflog entry' _multi_parts @ reflog_entries
|
||||||
reflog_entries=(${${(M)reflog_entries:#$IPREFIX*}#$IPREFIX})
|
|
||||||
_wanted reflog-entries expl 'reflog entry' compadd $* - $reflog_entries
|
|
||||||
else
|
|
||||||
reflog_entries=(${reflog_entries%@*})
|
|
||||||
_wanted reflog-entries expl 'reflog entry' compadd -qS @ $* - $reflog_entries
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_ref_sort_keys] )) ||
|
(( $+functions[__git_ref_sort_keys] )) ||
|
||||||
|
@ -5492,7 +5485,7 @@ __git_stashes () {
|
||||||
stashes=(${${(f)"$(_call_program stashes git stash list 2>/dev/null)"}/: */})
|
stashes=(${${(f)"$(_call_program stashes git stash list 2>/dev/null)"}/: */})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted stashes expl stash compadd $* - $stashes
|
_wanted stashes expl stash compadd "$@" -a - stashes
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_svn_revisions] )) ||
|
(( $+functions[__git_svn_revisions] )) ||
|
||||||
|
@ -5531,7 +5524,7 @@ __git_branch_names () {
|
||||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
_wanted branch-names expl branch-name compadd "$@" -a - branch_names
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_remote_branch_names] )) ||
|
(( $+functions[__git_remote_branch_names] )) ||
|
||||||
|
@ -5542,7 +5535,7 @@ __git_remote_branch_names () {
|
||||||
branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/})
|
branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names
|
_wanted remote-branch-names expl 'remote branch name' compadd "$@" -a - branch_names
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_remote_branch_names_noprefix] )) ||
|
(( $+functions[__git_remote_branch_names_noprefix] )) ||
|
||||||
|
@ -5553,7 +5546,7 @@ __git_remote_branch_names_noprefix () {
|
||||||
branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD})
|
branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted remote-branch-names-noprefix expl 'remote branch name' compadd $* - $branch_names
|
_wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_commits] )) ||
|
(( $+functions[__git_commits] )) ||
|
||||||
|
@ -5582,7 +5575,7 @@ __git_heads () {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted heads expl head compadd $* - $heads
|
_wanted heads expl head compadd "$@" -a - heads
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_commit_objects] )) ||
|
(( $+functions[__git_commit_objects] )) ||
|
||||||
|
@ -5678,7 +5671,7 @@ __git_submodules () {
|
||||||
submodules=(${${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#?* }%% *})
|
submodules=(${${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#?* }%% *})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted submodules expl submodule compadd $* - $submodules
|
_wanted submodules expl submodule compadd "$@" -a - submodules
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tag Argument Types
|
# Tag Argument Types
|
||||||
|
@ -5691,7 +5684,7 @@ __git_tags () {
|
||||||
tags=(${${(f)"$(_call_program tagrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
tags=(${${(f)"$(_call_program tagrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted tags expl tag compadd $* - $tags
|
_wanted tags expl tag compadd "$@" -a - tags
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_commit_tags] )) ||
|
(( $+functions[__git_commit_tags] )) ||
|
||||||
|
@ -5714,7 +5707,7 @@ __git_tags_of_type () {
|
||||||
tags=(${${(M)${(f)"$(_call_program $type-tag-refs "git for-each-ref --format='%(*objecttype)%(objecttype) %(refname)' refs/tags 2>/dev/null")"}:#$type(tag|) *}#$type(tag|) refs/tags/})
|
tags=(${${(M)${(f)"$(_call_program $type-tag-refs "git for-each-ref --format='%(*objecttype)%(objecttype) %(refname)' refs/tags 2>/dev/null")"}:#$type(tag|) *}#$type(tag|) refs/tags/})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted $type-tags expl "$type tag" compadd $* - $tags
|
_wanted $type-tags expl "$type tag" compadd "$@" -a - tags
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reference Argument Types
|
# Reference Argument Types
|
||||||
|
@ -5737,7 +5730,7 @@ __git_references () {
|
||||||
_git_refs_cache_pwd=$PWD
|
_git_refs_cache_pwd=$PWD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted references expl 'references' compadd - $_git_refs_cache
|
_wanted references expl 'reference' compadd -a - _git_refs_cache
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_local_references] )) ||
|
(( $+functions[__git_local_references] )) ||
|
||||||
|
@ -5750,7 +5743,7 @@ __git_local_references () {
|
||||||
_git_local_refs_cache_pwd=$PWD
|
_git_local_refs_cache_pwd=$PWD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted references expl 'references' compadd - $_git_local_refs_cache
|
_wanted references expl 'reference' compadd -a - _git_local_refs_cache
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_remote_references] )) ||
|
(( $+functions[__git_remote_references] )) ||
|
||||||
|
@ -5766,7 +5759,7 @@ __git_notes_refs () {
|
||||||
notes_refs=(${${(f)"$(_call_program notes-refs git for-each-ref --format='"%(refname)"' refs/notes 2>/dev/null)"}#$type refs/notes/})
|
notes_refs=(${${(f)"$(_call_program notes-refs git for-each-ref --format='"%(refname)"' refs/notes 2>/dev/null)"}#$type refs/notes/})
|
||||||
__git_command_successful $pipestatus || return 1
|
__git_command_successful $pipestatus || return 1
|
||||||
|
|
||||||
_wanted notes-refs expl 'notes ref' compadd $* - $notes_refs
|
_wanted notes-refs expl 'notes ref' compadd "$@" -a - notes_refs
|
||||||
}
|
}
|
||||||
|
|
||||||
# File Argument Types
|
# File Argument Types
|
||||||
|
@ -6406,7 +6399,6 @@ __git_config_values () {
|
||||||
# Git Config Sections and Types
|
# Git Config Sections and Types
|
||||||
(( $+functions[__git_browsers] )) ||
|
(( $+functions[__git_browsers] )) ||
|
||||||
__git_browsers () {
|
__git_browsers () {
|
||||||
integer ret=1
|
|
||||||
local expl
|
local expl
|
||||||
declare -a userbrowsers builtinbrowsers
|
declare -a userbrowsers builtinbrowsers
|
||||||
|
|
||||||
|
@ -6431,16 +6423,9 @@ __git_browsers () {
|
||||||
cygstart
|
cygstart
|
||||||
xdg-open)
|
xdg-open)
|
||||||
|
|
||||||
_tags user-browsers builtin-browsers
|
_alternative \
|
||||||
|
'user-browsers:user-defined browser:compadd -a - userbrowsers' \
|
||||||
while _tags; do
|
'builtin-browsers:builtin browser:compadd -a - builtinbrowsers'
|
||||||
_requested user-browsers expl 'user-defined browser' compadd $* - $userbrowsers && ret=0
|
|
||||||
_requested builtin-browsers expl 'builtin browser' compadd $* - $builtinbrowsers && ret=0
|
|
||||||
|
|
||||||
(( ret )) || break
|
|
||||||
done
|
|
||||||
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_difftools] )) ||
|
(( $+functions[__git_difftools] )) ||
|
||||||
|
@ -6483,10 +6468,10 @@ __git_diff-or-merge-tools () {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
while _tags; do
|
while _tags; do
|
||||||
_requested user-difftools expl 'user-defined difftool' compadd $* - $userdifftools && ret=0
|
_requested user-difftools expl 'user-defined difftool' compadd "$@" -a - userdifftools && ret=0
|
||||||
_requested user-mergetools expl 'user-defined mergetool' compadd $* - $usermergetools && ret=0
|
_requested user-mergetools expl 'user-defined mergetool' compadd "$@" -a - usermergetools && ret=0
|
||||||
_requested builtin-difftools expl 'builtin difftool' compadd $* - $builtindifftools && ret=0
|
_requested builtin-difftools expl 'builtin difftool' compadd "$@" -a - builtindifftools && ret=0
|
||||||
_requested builtin-mergetools expl 'builtin mergetool' compadd $* - $builtinmergetools && ret=0
|
_requested builtin-mergetools expl 'builtin mergetool' compadd "$@" -a - builtinmergetools && ret=0
|
||||||
|
|
||||||
(( ret )) || break
|
(( ret )) || break
|
||||||
done
|
done
|
||||||
|
@ -6577,20 +6562,18 @@ __git_sendemail_suppresscc_values () {
|
||||||
|
|
||||||
(( $+functions[__git_colors] )) ||
|
(( $+functions[__git_colors] )) ||
|
||||||
__git_colors () {
|
__git_colors () {
|
||||||
declare -a colors
|
declare -a expl
|
||||||
|
|
||||||
colors=(black red green yellow blue magenta cyan white)
|
_wanted colors expl color compadd "$@" - \
|
||||||
|
black red green yellow blue magenta cyan white
|
||||||
_describe -t colors color colors $*
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[__git_color_attributes] )) ||
|
(( $+functions[__git_color_attributes] )) ||
|
||||||
__git_color_attributes () {
|
__git_color_attributes () {
|
||||||
declare -a attributes
|
declare -a expl
|
||||||
|
|
||||||
attributes=(bold dim ul blink reverse)
|
_wanted attributes expl attribute compadd "$@" - \
|
||||||
|
bold dim ul blink reverse
|
||||||
_describe -t attributes attribute attributes $*
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Now, for the main drive...
|
# Now, for the main drive...
|
||||||
|
@ -6657,12 +6640,12 @@ _git() {
|
||||||
(option-or-argument)
|
(option-or-argument)
|
||||||
curcontext=${curcontext%:*:*}:git-$words[1]:
|
curcontext=${curcontext%:*:*}:git-$words[1]:
|
||||||
|
|
||||||
if (( $+functions[_git-$words[1]] )); then
|
if ! _call_function ret _git-$words[1]; then
|
||||||
_call_function ret _git-$words[1]
|
if zstyle -T :completion:$curcontext: use-fallback; then
|
||||||
elif zstyle -T :completion:$curcontext: use-fallback; then
|
_default && ret=0
|
||||||
_files && ret=0
|
else
|
||||||
else
|
_message "unknown sub-command: $words[1]"
|
||||||
_message 'unknown sub-command'
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -24,8 +24,8 @@ if compset -P '+[-0-9]#'; then
|
||||||
g:goto\ line
|
g:goto\ line
|
||||||
F:scroll\ to\ end\ and\ keep\ reading\ file
|
F:scroll\ to\ end\ and\ keep\ reading\ file
|
||||||
G:go\ to\ end\ of\ file
|
G:go\ to\ end\ of\ file
|
||||||
%:go\ to\ position\ in\ file
|
%:go\ to\ position\ in\ file
|
||||||
p:go\ to\ position\ in\ file
|
p:go\ to\ position\ in\ file
|
||||||
)'
|
)'
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -101,9 +101,9 @@ if [[ -n "$state" ]]; then
|
||||||
;;
|
;;
|
||||||
tags)
|
tags)
|
||||||
if (( $+LESSGLOBALTAGS )); then
|
if (( $+LESSGLOBALTAGS )); then
|
||||||
_global_tags
|
_global_tags && ret=0
|
||||||
else
|
else
|
||||||
_ctags_tags
|
_ctags_tags && ret=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -5,16 +5,16 @@ if (( CURRENT == 2 )); then
|
||||||
|
|
||||||
local lhacmds
|
local lhacmds
|
||||||
lhacmds=(
|
lhacmds=(
|
||||||
'( x l v u d m c p t)a[Add \(Or replace\) to archive]'
|
'( x l v u d m c p t)a[add \(or replace\) to archive]'
|
||||||
'(a l v u d m c p t)x[EXtract from archive]'
|
'(a l v u d m c p t)x[extract from archive]'
|
||||||
'(a x v u d m c p t)l[List]'
|
'(a x v u d m c p t)l[list]'
|
||||||
'(a x l u d m c p t)v[Verbose List]'
|
'(a x l u d m c p t)v[verbose List]'
|
||||||
'(a x l v d m c p t)u[Update newer files to archive]'
|
'(a x l v d m c p t)u[update newer files to archive]'
|
||||||
'(a x l v u m c p t)d[Delete from archive]'
|
'(a x l v u m c p t)d[delete from archive]'
|
||||||
'(a x l v u d c p t)m[Move to archive]'
|
'(a x l v u d c p t)m[move to archive]'
|
||||||
'(a x l v u d m p t)c[re-Construct new archive]'
|
'(a x l v u d m p t)c[re-construct new archive]'
|
||||||
'(a x l v u d m c t)p[Print to STDOUT from archive]'
|
'(a x l v u d m c t)p[print to stdout from archive]'
|
||||||
'(a x l v u d m c p )t[Test file CRC in archive]'
|
'(a x l v u d m c p )t[test file CRC in archive]'
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ "${words[2]#-}" != "" ]; then
|
if [ "${words[2]#-}" != "" ]; then
|
||||||
|
@ -23,22 +23,22 @@ if (( CURRENT == 2 )); then
|
||||||
'q[quiet]'
|
'q[quiet]'
|
||||||
'n[not execute]'
|
'n[not execute]'
|
||||||
'f[force\(over write at extract\)]'
|
'f[force\(over write at extract\)]'
|
||||||
't[FILES are TEXT file]'
|
't[files are text files]'
|
||||||
'e[TEXT code convert from/to EUC]'
|
'e[text code convert from/to EUC]'
|
||||||
'g[Generic format \(for compatibility\)]'
|
'g[use generic format \(for compatibility\)]'
|
||||||
)
|
)
|
||||||
case ${words[2]#-} in
|
case ${words[2]#-} in
|
||||||
a*|u*)
|
a*|u*)
|
||||||
lhacmds=($lhacmds
|
lhacmds=($lhacmds
|
||||||
'd[delete FILES after]'
|
'd[delete files after]'
|
||||||
'z[files not compress]'
|
"z[don't compress files]"
|
||||||
'( 1 2)0[header level 0]'
|
'( 1 2)0[header level 0]'
|
||||||
'(0 2)1[header level 1]'
|
'(0 2)1[header level 1]'
|
||||||
'(0 1 )2[header level 2]'
|
'(0 1 )2[header level 2]'
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
c*)
|
c*)
|
||||||
lhacmds=($lhacmds 'd[delete FILES after]')
|
lhacmds=($lhacmds 'd[delete files after]')
|
||||||
;;
|
;;
|
||||||
x*)
|
x*)
|
||||||
lhacmds=($lhacmds 'i[ignore directory path]')
|
lhacmds=($lhacmds 'i[ignore directory path]')
|
||||||
|
@ -46,32 +46,25 @@ if (( CURRENT == 2 )); then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_values -s '' 'lha command' \
|
_values -s '' 'lha command' $lhacmds
|
||||||
$lhacmds \
|
|
||||||
&& return 0
|
|
||||||
elif (( CURRENT == 3 )); then
|
elif (( CURRENT == 3 )); then
|
||||||
_arguments -C \
|
_wanted files expl 'lha file' _files -g '*.lzh(-.)'
|
||||||
'*:LHA file:_files -g \*.lzh' && return 0
|
|
||||||
else
|
else
|
||||||
case ${words[2]#-} in
|
case ${words[2]#-} in
|
||||||
l*|x*|d*)
|
l*|x*|d*)
|
||||||
if [ -f "$words[3]" ]; then
|
if [ -f "$words[3]" ]; then
|
||||||
_lzh_cache_list=`$words[1] lq $words[3] | awk '{print $8}'`
|
_lzh_cache_list=`$words[1] lq $words[3] | awk '{print $NF}'`
|
||||||
_lzh_cache_list=("${(@f)${_lzh_cache_list}}")
|
_lzh_cache_list=("${(@f)${_lzh_cache_list}}")
|
||||||
|
|
||||||
_wanted files expl 'file from archive' _multi_parts / _lzh_cache_list
|
_wanted files expl 'file from archive' _multi_parts / _lzh_cache_list
|
||||||
|
|
||||||
return 0
|
|
||||||
else
|
else
|
||||||
_message -r "Archive file is not found : ${words[3]}"
|
_message -r "archive file is not found : ${words[3]}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_arguments -C \
|
_files
|
||||||
'*:file:_files' && return 0
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
#compdef metaflac
|
#compdef metaflac
|
||||||
|
|
||||||
local _metaflac_opts _metaflac_shorts _metaflac_opers
|
local _metaflac_opts _metaflac_shorts _metaflac_opers
|
||||||
typeset -A opt_args
|
|
||||||
function _metaflac_tags () {
|
_metaflac_opts=(
|
||||||
echo "\n\nBEEP - $line - BEEP\n\n"
|
'--preserve-modtime'
|
||||||
}
|
'--with-filename[prefix output with filename]'
|
||||||
_metaflac_opts=(
|
'--no-filename'
|
||||||
'--preserve-modtime'
|
|
||||||
'--with-filename[prefix output with filename]'
|
|
||||||
'--no-filename'
|
|
||||||
'--no-utf8-convert'
|
'--no-utf8-convert'
|
||||||
'--dont-use-padding[always rewrite the file]'
|
'--dont-use-padding[always rewrite the file]'
|
||||||
)
|
)
|
||||||
_metaflac_shorts=(
|
_metaflac_shorts=(
|
||||||
'--show-md5sum'
|
'--show-md5sum'
|
||||||
|
@ -23,7 +20,7 @@ _metaflac_shorts=(
|
||||||
'--show-bps'
|
'--show-bps'
|
||||||
'--show-total-samples'
|
'--show-total-samples'
|
||||||
'--show-vendor-tag'
|
'--show-vendor-tag'
|
||||||
'--show-tag=:FLAC tags:_metaflac_tags'
|
'--show-tag=:FLAC tags'
|
||||||
'--remove-tag=:FLAC tags: '
|
'--remove-tag=:FLAC tags: '
|
||||||
'--remove-first-tag=:FLAC tags: '
|
'--remove-first-tag=:FLAC tags: '
|
||||||
'--remove-all-tags'
|
'--remove-all-tags'
|
||||||
|
@ -51,9 +48,7 @@ _metaflac_opers=(
|
||||||
|
|
||||||
_arguments "$_metaflac_opts[@]" \
|
_arguments "$_metaflac_opts[@]" \
|
||||||
"*:FLAC file:_files -g \*.flac\(-.\)" \
|
"*:FLAC file:_files -g \*.flac\(-.\)" \
|
||||||
- "shortcuts" \
|
- "shortcuts" \
|
||||||
"$_metaflac_shorts[@]" \
|
"$_metaflac_shorts[@]" \
|
||||||
- "(operations)" \
|
- "(operations)" \
|
||||||
"$_metaflac_opers[@]" \
|
"$_metaflac_opers[@]"
|
||||||
&& return 0
|
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,9 @@ _module()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (( CURRENT == 1 )); then
|
if (( CURRENT == 1 )); then
|
||||||
_describe -t commands 'module command' _module_cmds || compadd "$@"
|
_describe -t commands 'module command' _module_cmds
|
||||||
else
|
else
|
||||||
local curcontext="$curcontext"
|
local curcontext="$curcontext" ret
|
||||||
|
|
||||||
cmd="${${_module_cmds[(r)$words[1]:*]%%:*}}"
|
cmd="${${_module_cmds[(r)$words[1]:*]%%:*}}"
|
||||||
# Deal with any aliases
|
# Deal with any aliases
|
||||||
|
@ -65,7 +65,7 @@ _module()
|
||||||
show) cmd="display";;
|
show) cmd="display";;
|
||||||
keyword) cmd="apropos";;
|
keyword) cmd="apropos";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if (( $#cmd ));
|
if (( $#cmd ));
|
||||||
then
|
then
|
||||||
local update_policy
|
local update_policy
|
||||||
|
@ -132,7 +132,7 @@ _module_available_modules()
|
||||||
{
|
{
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'(-a --append)'{--append,-a}'[append the directories instead of prepending]' \
|
'(-a --append)'{--append,-a}'[append the directories instead of prepending]' \
|
||||||
'*:directory:_files -/'
|
'*:directory:_files -/'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Completion function for unuse
|
# Completion function for unuse
|
||||||
|
|
|
@ -1,8 +1,22 @@
|
||||||
#compdef mtn
|
#compdef mtn
|
||||||
|
|
||||||
local context state line ret
|
local -a cmds
|
||||||
typeset -a cmds
|
cmds=(
|
||||||
typeset -A opt_args
|
automate:automation db:database fdiff:debug fload:debug fmerge:debug
|
||||||
|
get_roster:debug identify:debug rcs_import:debug annotate:informative
|
||||||
|
cat:informative complete:informative diff:informative help:informative
|
||||||
|
list:informative log:informative ls:informative show_conflicts:informative
|
||||||
|
status:informative cert:key+cert chkeypass:key+cert dropkey:key+cert
|
||||||
|
genkey:key+cert trusted:key+cert pull:network push:network serve:network
|
||||||
|
sync:network privkey:packet\ i/o pubkey:packet\ i/o read:packet\ i/o
|
||||||
|
cvs_import:rcs approve:review comment:review disapprove:review tag:review
|
||||||
|
testresult:review checkout:tree co:tree explicit_merge:tree heads:tree
|
||||||
|
merge:tree merge_into_dir:tree migrate_workspace:tree propagate:tree
|
||||||
|
refresh_inodeprints:tree setup:tree set:vars unset:vars add:workspace
|
||||||
|
attr:workspace ci:workspace commit:workspace drop:workspace mv:workspace
|
||||||
|
pivot_root:workspace pluck:workspace rename:workspace revert:workspace
|
||||||
|
rm:workspace update:workspace
|
||||||
|
)
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
'--brief[print a brief version of the normal output]' \
|
'--brief[print a brief version of the normal output]' \
|
||||||
|
@ -25,17 +39,5 @@ _arguments \
|
||||||
'--ticker[set ticker style]:ticker style:(count dot none)' \
|
'--ticker[set ticker style]:ticker style:(count dot none)' \
|
||||||
'--version[print version number, then exit]' \
|
'--version[print version number, then exit]' \
|
||||||
'(-@ --xargs)'{-@,--xargs}'[insert command line arguments taken from the given file]:file:_files' \
|
'(-@ --xargs)'{-@,--xargs}'[insert command line arguments taken from the given file]:file:_files' \
|
||||||
'*:command:->cmd' && return 0
|
'1:command: _describe -t commands command cmds' \
|
||||||
|
'*:file:_files'
|
||||||
case "$state" in
|
|
||||||
(cmd)
|
|
||||||
if (( CURRENT == 2 )); then
|
|
||||||
cmds=(automate:automation db:database fdiff:debug fload:debug fmerge:debug get_roster:debug identify:debug rcs_import:debug annotate:informative cat:informative complete:informative diff:informative help:informative list:informative log:informative ls:informative show_conflicts:informative status:informative cert:key+cert chkeypass:key+cert dropkey:key+cert genkey:key+cert trusted:key+cert pull:network push:network serve:network sync:network privkey:packet\ i/o pubkey:packet\ i/o read:packet\ i/o cvs_import:rcs approve:review comment:review disapprove:review tag:review testresult:review checkout:tree co:tree explicit_merge:tree heads:tree merge:tree merge_into_dir:tree migrate_workspace:tree propagate:tree refresh_inodeprints:tree setup:tree set:vars unset:vars add:workspace attr:workspace ci:workspace commit:workspace drop:workspace mv:workspace pivot_root:workspace pluck:workspace rename:workspace revert:workspace rm:workspace update:workspace)
|
|
||||||
_describe -t commands 'cmds' cmds && ret=0
|
|
||||||
else
|
|
||||||
_files
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return ret
|
|
||||||
|
|
|
@ -68,21 +68,21 @@ _mpc_command() {
|
||||||
)
|
)
|
||||||
|
|
||||||
if (( CURRENT == 1 )); then
|
if (( CURRENT == 1 )); then
|
||||||
_describe -t command "mpc commands" mpc_cmds
|
_describe -t commands "mpc command" mpc_cmds
|
||||||
else
|
else
|
||||||
local curcontext="$curcontext"
|
local cmd=$words[1]
|
||||||
|
local curcontext="${curcontext%:*}:mpc-${cmd}" ret=1
|
||||||
|
if ! _call_function ret _mpc_$cmd; then
|
||||||
|
_default && ret=0
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local cmd=$words[1]
|
|
||||||
|
|
||||||
local curcontext="${curcontext%:*}:mpc-${cmd}"
|
|
||||||
_call_function ret _mpc_$cmd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_mpc_helper_bool() {
|
_mpc_helper_bool() {
|
||||||
local expl states
|
local expl states
|
||||||
states=(on off yes no 1 0 true false)
|
states=(on off yes no 1 0 true false)
|
||||||
_wanted states expl boolean compadd $expl -a states
|
_wanted states expl boolean compadd -a states
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_mpc_helper_songnumbers] )) ||
|
(( $+functions[_mpc_helper_songnumbers] )) ||
|
||||||
|
@ -100,7 +100,7 @@ _mpc_helper_songnumbers() {
|
||||||
NM="$compstate[nmatches]"
|
NM="$compstate[nmatches]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
out=("${(@f)$(_call_program song-numbers mpc $foo playlist 2>/dev/null)}")
|
out=("${(@f)$(_call_program song-numbers mpc $foo playlist)}")
|
||||||
out=("${(@M)out[@]:#${~MATCH}}")
|
out=("${(@M)out[@]:#${~MATCH}}")
|
||||||
|
|
||||||
sn=("${(@)${(@M)out}//(#b)(#s)(\#|[ >]#)([0-9]#)*/$match[2]}")
|
sn=("${(@)${(@M)out}//(#b)(#s)(\#|[ >]#)([0-9]#)*/$match[2]}")
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#compdef nc netcat
|
#compdef nc netcat
|
||||||
|
|
||||||
local curcontext="$curcontext" state line expl
|
|
||||||
typeset -A opt_args
|
|
||||||
|
|
||||||
# handle name clash with the nedit client
|
# handle name clash with the nedit client
|
||||||
[[ $service = nc ]] && ! _pick_variant netcat=connect nedit -h &&
|
if [[ $service = nc ]] && ! _pick_variant netcat=connect nedit -h; then
|
||||||
_nedit && return
|
_nedit
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if (( ! $+_nc_args )); then
|
if (( ! $+_nc_args )); then
|
||||||
local help="$(_call_program options $words[1] -h < /dev/null 2>&1)"
|
local help="$(_call_program options $words[1] -h < /dev/null 2>&1)"
|
||||||
|
@ -14,17 +13,17 @@ if (( ! $+_nc_args )); then
|
||||||
'*-e prog*' '-e+[program to exec after connect]:prog:_command_names -e'
|
'*-e prog*' '-e+[program to exec after connect]:prog:_command_names -e'
|
||||||
'*-g gateway*' '-g+[source-routing hop point]:gateway:_hosts'
|
'*-g gateway*' '-g+[source-routing hop point]:gateway:_hosts'
|
||||||
'*-G num*' '-G[source-routing pointer: 4, 8, 12]'
|
'*-G num*' '-G[source-routing pointer: 4, 8, 12]'
|
||||||
'*-i secs*' '-i+[delay interval for lines sent or ports scanned]:secs:'
|
'*-i secs*' '-i+[delay interval for lines sent or ports scanned]:delay (secs)'
|
||||||
'*-l*' '-l[listen mode]'
|
'*-l*' '-l[listen mode]'
|
||||||
'*-n*' '-n[numeric-only IP addresses, no DNS]'
|
'*-n*' '-n[numeric-only IP addresses, no DNS]'
|
||||||
'*-o file*' '-o+[hex dump of traffic]:file:_files'
|
'*-o file*' '-o+[hex dump of traffic]:file:_files'
|
||||||
'*-p port*' '-p+[local port number]:port:_ports'
|
'*-p port*' '-p+[local port number]:port:_ports'
|
||||||
'*-r*' '-r[randomize local and remote ports]'
|
'*-r*' '-r[randomize local and remote ports]'
|
||||||
'*-q secs*' '-q+[quit after EOF on stdin and delay of secs]:secs:'
|
'*-q secs*' '-q+[quit after EOF on stdin and delay of secs]:delay (secs)'
|
||||||
'*-t*' '-t[answer TELNET negotiation]'
|
'*-t*' '-t[answer TELNET negotiation]'
|
||||||
'*-u*' '-u[UDP mode]'
|
'*-u*' '-u[UDP mode]'
|
||||||
'*-v*' '-v[verbose]'
|
'*-v*' '-v[verbose]'
|
||||||
'*-w secs*' '-w+[timeout for connects and final net reads]:secs:'
|
'*-w secs*' '-w+[timeout for connects and final net reads]:timeout (secs)'
|
||||||
'*-z*' '-z[zero-I/O mode]'
|
'*-z*' '-z[zero-I/O mode]'
|
||||||
'*-x*' '-x'
|
'*-x*' '-x'
|
||||||
'*-b*' '-b[allow broadcasts]'
|
'*-b*' '-b[allow broadcasts]'
|
||||||
|
@ -32,7 +31,7 @@ if (( ! $+_nc_args )); then
|
||||||
_nc_args=($optionmap[(K)"$help"])
|
_nc_args=($optionmap[(K)"$help"])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_arguments -C -s \
|
_arguments -s \
|
||||||
"$_nc_args[@]" \
|
"$_nc_args[@]" \
|
||||||
':host:_hosts' \
|
':host:_hosts' \
|
||||||
':port:_ports' && return 0
|
':port:_ports'
|
||||||
|
|
|
@ -57,12 +57,15 @@ _notmuch_search()
|
||||||
|
|
||||||
_notmuch()
|
_notmuch()
|
||||||
{
|
{
|
||||||
|
local ret=1
|
||||||
if (( CURRENT > 2 )) ; then
|
if (( CURRENT > 2 )) ; then
|
||||||
local cmd=${words[2]}
|
local cmd=${words[2]}
|
||||||
curcontext="${curcontext%:*:*}:notmuch-$cmd"
|
curcontext="${curcontext%:*:*}:notmuch-$cmd"
|
||||||
(( CURRENT-- ))
|
(( CURRENT-- ))
|
||||||
shift words
|
shift words
|
||||||
_call_function ret _notmuch_$cmd
|
if ! _call_function ret _notmuch_$cmd; then
|
||||||
|
_default && ret=0
|
||||||
|
fi
|
||||||
return ret
|
return ret
|
||||||
else
|
else
|
||||||
_notmuch_commands
|
_notmuch_commands
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef pkg-config
|
#compdef pkg-config
|
||||||
|
|
||||||
local arguments packages curcontext="$curcontext" stat line
|
local arguments packages curcontext="$curcontext" state line ret=1
|
||||||
declare -A opt_args
|
declare -A opt_args
|
||||||
|
|
||||||
arguments=(
|
arguments=(
|
||||||
|
@ -11,31 +11,33 @@ arguments=(
|
||||||
"--print-errors[cause errors to be printed]"
|
"--print-errors[cause errors to be printed]"
|
||||||
"--silence-errors[prevent the printing of errors]"
|
"--silence-errors[prevent the printing of errors]"
|
||||||
"--errors-to-stdout[print errors to stdout rather than stderr]"
|
"--errors-to-stdout[print errors to stdout rather than stderr]"
|
||||||
"--cflags[prints the preprocessor and compile flags]"
|
"--cflags[print the preprocessor and compiler flags]"
|
||||||
"--cflags-only-I[output -I flags only]"
|
"--cflags-only-I[output -I flags only]"
|
||||||
"--cflags-only-other[output cflags not covered by the cflags-only-I option]"
|
"--cflags-only-other[output cflags not covered by the cflags-only-I option]"
|
||||||
"--debug[show verbose debug information]"
|
"--debug[show verbose debug information]"
|
||||||
"--libs[prints the link flags]"
|
"--libs[print the link flags]"
|
||||||
"--libs-only-L[prints the -L and -R parts of \"--libs\"]"
|
"--libs-only-L[print the -L and -R parts of \"--libs\"]"
|
||||||
"--libs-only-l[prints the -l part of \"--libs\"]"
|
"--libs-only-l[print the -l part of \"--libs\"]"
|
||||||
"--libs-only-other[output other libs]"
|
"--libs-only-other[output other libs]"
|
||||||
"--list-all[list all known packages]"
|
"--list-all[list all known packages]"
|
||||||
"--variable=[return the value of the specified variable]:variable"
|
"--variable=[return the value of the specified variable]:variable"
|
||||||
"--define-variable=[set the global value for a variable]:name value pair"
|
"--define-variable=[set the global value for a variable]:name value pair"
|
||||||
"--uninstalled[return successfully if any \"-uninstalled\" packages are being used and fails otherwise]"
|
"--uninstalled[return success if any \"-uninstalled\" packages are being used]"
|
||||||
"--exists[tests whether the package exists or not]"
|
"--exists[test whether the package exists or not]"
|
||||||
"--atleast-version=[test whether the version is at least that of the specified value]:least value"
|
"--atleast-version=[test whether the version is at least that of the specified value]:least value"
|
||||||
"--exact-version=[test whether the version is exactly that of the specified value]:exact value"
|
"--exact-version=[test whether the version is exactly that of the specified value]:exact value"
|
||||||
"--max-version=[test whether the version is no greater than some specific value]:max version"
|
"--max-version=[test whether the version is no greater than some specific value]:max version"
|
||||||
# "--msvc-syntax[output linker flags in a form compatible with MSVC++ (Windows only)]"
|
# "--msvc-syntax[output linker flags in a form compatible with MSVC++ (Windows only)]"
|
||||||
# "--dont-define-prefix[disables automatic overiding of the variable \"prefix\" (Windows only)]"
|
# "--dont-define-prefix[disables automatic overiding of the variable \"prefix\" (Windows only)]"
|
||||||
# "--prefix-variable=[set the name of the variable \"prefix\" (Windows only)]:prefix value"
|
# "--prefix-variable=[set the name of the variable \"prefix\" (Windows only)]:prefix value"
|
||||||
"*:package name:->package"
|
"*: :->packages"
|
||||||
)
|
)
|
||||||
|
|
||||||
_arguments -C $arguments
|
_arguments -C $arguments && ret=0
|
||||||
|
|
||||||
if [[ -n $state ]] ; then
|
if [[ -n $state ]] ; then
|
||||||
packages=( ${(f)"$((pkg-config --list-all | cut -d' ' -f1) 2>/dev/null)"} )
|
packages=( ${${(f)"$(_call_program packages pkg-config --list-all)"}%% *} )
|
||||||
compadd -a - packages
|
_wanted packages expl 'package' compadd -a - packages && ret=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -45,7 +45,7 @@ _arguments \
|
||||||
'--source=[load or configure a SourceHandler]:source:' \
|
'--source=[load or configure a SourceHandler]:source:' \
|
||||||
{-a,--archive}'[store output in archive file]:file:_files' \
|
{-a,--archive}'[store output in archive file]:file:_files' \
|
||||||
{-j,--jobs}'[run N jobs in parallel]:jobs:' \
|
{-j,--jobs}'[run N jobs in parallel]:jobs:' \
|
||||||
'*--state=[control persistent state]:state:' \
|
'*--state=[control persistent state]: :_values -s , state last failed passed all hot todo slow fast new old fresh save' \
|
||||||
'--rc=[custom rcfile]:file:_files' \
|
'--rc=[custom rcfile]:file:_files' \
|
||||||
'*:file or directory:_files' \
|
'*--rules=[limit tests run (or not) in parallel]:rules' \
|
||||||
&& return 0
|
'*:file or directory:_files'
|
||||||
|
|
|
@ -38,7 +38,7 @@ common=(
|
||||||
case $service in
|
case $service in
|
||||||
unrar)
|
unrar)
|
||||||
if (( CURRENT == 2 )); then
|
if (( CURRENT == 2 )); then
|
||||||
_values 'rar command' \
|
_values 'rar command' \
|
||||||
'e[extract files to current directory]' \
|
'e[extract files to current directory]' \
|
||||||
'l[list archive]' \
|
'l[list archive]' \
|
||||||
'lt[list archive (technical format)]' \
|
'lt[list archive (technical format)]' \
|
||||||
|
@ -48,7 +48,7 @@ case $service in
|
||||||
'v[verbosely list archive]' \
|
'v[verbosely list archive]' \
|
||||||
'vt[verbosely list archive (technical format)]' \
|
'vt[verbosely list archive (technical format)]' \
|
||||||
'vb[verbosely list archive (bare format)]' \
|
'vb[verbosely list archive (bare format)]' \
|
||||||
'x[extract files with full path]' && return
|
'x[extract files with full path]'
|
||||||
else
|
else
|
||||||
_arguments -S \
|
_arguments -S \
|
||||||
'-ep3[expand paths to full including the drive letter]' \
|
'-ep3[expand paths to full including the drive letter]' \
|
||||||
|
@ -58,7 +58,7 @@ case $service in
|
||||||
'-n+:file to include:_files' \
|
'-n+:file to include:_files' \
|
||||||
'-n@+:file of files to include:_files' \
|
'-n@+:file of files to include:_files' \
|
||||||
"$common[@]" \
|
"$common[@]" \
|
||||||
'*:RAR files:_files -g \*.rar\(-.\)' && return
|
'*:RAR files:_files -g \*.rar\(-.\)'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
rar)
|
rar)
|
||||||
|
@ -89,7 +89,7 @@ case $service in
|
||||||
'v[verbosely list archive]' \
|
'v[verbosely list archive]' \
|
||||||
'vt[verbosely list archive (technical format)]' \
|
'vt[verbosely list archive (technical format)]' \
|
||||||
'vb[verbosely list archive (bare format)]' \
|
'vb[verbosely list archive (bare format)]' \
|
||||||
'x[extract files with full path]' && return
|
'x[extract files with full path]'
|
||||||
else
|
else
|
||||||
_arguments -S \
|
_arguments -S \
|
||||||
'-ag[generate archive name using the current date]' \
|
'-ag[generate archive name using the current date]' \
|
||||||
|
@ -126,7 +126,7 @@ case $service in
|
||||||
'-w+[assign work directory]:work directory:_files -/' \
|
'-w+[assign work directory]:work directory:_files -/' \
|
||||||
"$common[@]" \
|
"$common[@]" \
|
||||||
'-z+[read archive comment from file]:comment file:_files' \
|
'-z+[read archive comment from file]:comment file:_files' \
|
||||||
'*:files:_files' && return
|
'*:files:_files'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -35,10 +35,10 @@ if compset -P '*::*/' || compset -P 'rsync://*/*/'; then
|
||||||
# attrs size date time name
|
# attrs size date time name
|
||||||
|
|
||||||
_wanted files expl 'remote file or directory' \
|
_wanted files expl 'remote file or directory' \
|
||||||
compadd -d remdispf ${${${${remdispf##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}
|
compadd -d remdispf ${${${${remdispf##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##} && ret=0
|
||||||
|
|
||||||
_wanted files expl 'remote file or directory' \
|
_wanted files expl 'remote file or directory' \
|
||||||
compadd -S/ -d remdispd ${${${${remdispd##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}
|
compadd -S/ -d remdispd ${${${${remdispd##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##} || (( ! ret ))
|
||||||
|
|
||||||
elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
|
elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,24 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_rubber_args=(
|
_rubber_args=(
|
||||||
\*{-c,--command}'=[run the directive CMD before parsing]:command'
|
\*{-c,--command}'=[run specified directive command before parsing]:command'
|
||||||
\*{-e,--epilogue}'=[run the directive CMD after parsing]:command'
|
\*{-e,--epilogue}'=[run specified directive command after parsing]:command'
|
||||||
{-z,--gzip}'[compress the final document]'
|
'(-z --gzip)'{-z,--gzip}'[compress the final document]'
|
||||||
'(- *)'{-h,--help}'[show help]'
|
'(- *)'{-h,--help}'[show help information]'
|
||||||
'--into=[go to directory DIR before compiling]:directory:_files -/'
|
'--into=[go to specified directory before compiling]:directory:_files -/'
|
||||||
{-l,--landscape}'[change paper orientation (if relevant)]'
|
'(-l --landscape)'{-l,--landscape}'[change paper orientation (if relevant)]'
|
||||||
{-n,--maxerr}'=[display at most NUM errors]:num'
|
'(-n --maxerr)'{-n,--maxerr}'=[display at most specified number of errors]:number'
|
||||||
\*{-m,--module}'=[use module]:module:($_rubber_modules)'
|
\*{-m,--module}'=[use module]:module:($_rubber_modules)'
|
||||||
'--only=[only include the specified SOURCES]:sources'
|
'--only=[only include the specified sources]:sources'
|
||||||
\*{-o,--post}'=[postprocess with module]:postprocessor:($_rubber_modules)'
|
\*{-o,--post}'=[postprocess with module]:postprocessor:($_rubber_modules)'
|
||||||
{-d,--pdf}'[produce PDF output instead of DVI]'
|
'(-d --pdf -p -ps)'{-d,--pdf}'[produce PDF output instead of DVI]'
|
||||||
{-p,--ps}'[produce a PostScript document]'
|
'(-p -ps -d --pdf)'{-p,--ps}'[produce a PostScript document]'
|
||||||
{-q,--quiet}'[suppress messages]'
|
{-q,--quiet}'[suppress messages]'
|
||||||
\*{-r,--read}'[read additional directives from a file]:directives files:_files'
|
\*{-r,--read}'[read additional directives from a file]:directives files:_files'
|
||||||
{-s,--short}'[display errors in a compact form]'
|
{-s,--short}'[display errors in compact form]'
|
||||||
\*{-I,--texpath}'=[add DIR to the search path for LaTeX]:tex path:_files -/'
|
\*{-I,--texpath}'=[add directory to the search path for LaTeX]:tex path:_files -/'
|
||||||
\*{-v,--verbose}'[increase verbosity]'
|
\*{-v,--verbose}'[increase verbosity]'
|
||||||
'--version[print version information and exit]'
|
'--version[print version information and exit]'
|
||||||
)
|
)
|
||||||
|
|
||||||
case "$service" in
|
case "$service" in
|
||||||
|
@ -42,17 +42,15 @@ case "$service" in
|
||||||
'--clean[remove produced files instead of compiling]' \
|
'--clean[remove produced files instead of compiling]' \
|
||||||
{-f,--force}'[force at least one compilation]' \
|
{-f,--force}'[force at least one compilation]' \
|
||||||
'--inplace[compile the documents from their source directory]' \
|
'--inplace[compile the documents from their source directory]' \
|
||||||
\*{-W,--warn}'=[report warnings of the given TYPE]:warnings:(all boxes misc refs)' \
|
\*{-W,--warn}'=[report warnings of the given type]:warnings:(all boxes misc refs)' \
|
||||||
'*:LaTeX files:_files -g "*.(tex|dtx|lhs|w)(-.)"'
|
'*:LaTeX files:_files -g "*.(tex|dtx|lhs|w)(-.)"'
|
||||||
return 0
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rubber-pipe)
|
rubber-pipe)
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
"$_rubber_args[@]" \
|
"$_rubber_args[@]" \
|
||||||
{-k,--keep}'[keep the temporary files after compiling]' \
|
{-k,--keep}'[keep the temporary files after compiling]' \
|
||||||
\*{-W,--warn}'=[report warnings of the given TYPE]:warnings:(all boxes misc refs)'
|
\*{-W,--warn}'=[report warnings of the given type]:warnings:(all boxes misc refs)'
|
||||||
return 0
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rubber-info)
|
rubber-info)
|
||||||
|
@ -65,8 +63,5 @@ case "$service" in
|
||||||
'--refs[show the list of undefined references]' \
|
'--refs[show the list of undefined references]' \
|
||||||
'--warnings[show all LaTeX warnings]' \
|
'--warnings[show all LaTeX warnings]' \
|
||||||
':LaTeX file:_files -g "*.(tex|dtx|lhs|w)(-.)"'
|
':LaTeX file:_files -g "*.(tex|dtx|lhs|w)(-.)"'
|
||||||
return 0
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
|
@ -20,15 +20,8 @@ _arguments -C \
|
||||||
if [[ -n "$state" ]]; then
|
if [[ -n "$state" ]]; then
|
||||||
mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}"
|
mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}"
|
||||||
[[ $mode = (chain|batch-[xs]) ]] || mode=default
|
[[ $mode = (chain|batch-[xs]) ]] || mode=default
|
||||||
_tags assignments files
|
_tags files assignments
|
||||||
while _tags; do
|
while _tags; do
|
||||||
if _requested assignments; then
|
|
||||||
if [[ -prefix *= ]]; then
|
|
||||||
_message -e value value
|
|
||||||
else
|
|
||||||
_message -e parameter 'parameter name'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if _requested files; then
|
if _requested files; then
|
||||||
case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in
|
case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in
|
||||||
default:1|chain:<3->|batch-x:2|batch-s:1)
|
default:1|chain:<3->|batch-x:2|batch-s:1)
|
||||||
|
@ -45,6 +38,13 @@ if [[ -n "$state" ]]; then
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
if _requested assignments; then
|
||||||
|
if [[ -prefix *= ]]; then
|
||||||
|
_message -e value value
|
||||||
|
else
|
||||||
|
_message -e parameter 'parameter name' && ret=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
(( ret )) || break
|
(( ret )) || break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,20 +1,8 @@
|
||||||
#compdef screen
|
#compdef screen
|
||||||
|
|
||||||
local curcontext="$curcontext" state line expl
|
local curcontext="$curcontext" state line expl ret=1
|
||||||
local scr_cmds sessions
|
local scr_cmds sessions
|
||||||
|
|
||||||
function __screen_normal() {
|
|
||||||
if (( CURRENT == 1 )) && [[ $PREFIX == /dev/* ]]; then
|
|
||||||
_path_files -g '*(%)'
|
|
||||||
elif (( CURRENT == 2 )) && [[ ${words[1]} == /dev/* ]]; then
|
|
||||||
_message "baud rate"
|
|
||||||
elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then
|
|
||||||
_message "no more parameters"
|
|
||||||
else
|
|
||||||
_normal "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
scr_cmds=(
|
scr_cmds=(
|
||||||
acladd aclchg acldel aclgrp
|
acladd aclchg acldel aclgrp
|
||||||
aclumask activity addacl allpartial
|
aclumask activity addacl allpartial
|
||||||
|
@ -103,10 +91,21 @@ _arguments -C \
|
||||||
'-Dx: :->any-sessions' \
|
'-Dx: :->any-sessions' \
|
||||||
'-dx: :->any-sessions' \
|
'-dx: :->any-sessions' \
|
||||||
'-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \
|
'-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \
|
||||||
'*::arguments: __screen_normal'
|
'*:: :->normal' && ret=0
|
||||||
|
|
||||||
if [[ -n $state ]]; then
|
if [[ -n $state ]]; then
|
||||||
case $state in
|
case $state in
|
||||||
|
normal)
|
||||||
|
if (( CURRENT == 1 )) && [[ $PREFIX == /dev/* ]]; then
|
||||||
|
_path_files -g '*(%)'
|
||||||
|
elif (( CURRENT == 2 )) && [[ ${words[1]} == /dev/* ]]; then
|
||||||
|
_message "baud rate"
|
||||||
|
elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then
|
||||||
|
_message "no more parameters"
|
||||||
|
else
|
||||||
|
_normal
|
||||||
|
fi
|
||||||
|
;;
|
||||||
attached-sessions)
|
attached-sessions)
|
||||||
sessions=(
|
sessions=(
|
||||||
${${${(M)${(f)"$(_call_program screen-sessions $words[1] \
|
${${${(M)${(f)"$(_call_program screen-sessions $words[1] \
|
||||||
|
@ -134,4 +133,6 @@ if [[ -n $state ]]; then
|
||||||
_wanted screen-sessions expl "${state%-*} screen process" \
|
_wanted screen-sessions expl "${state%-*} screen process" \
|
||||||
compadd ${sessions#*.}
|
compadd ${sessions#*.}
|
||||||
fi
|
fi
|
||||||
fi
|
fi && ret=0
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
|
@ -40,11 +40,11 @@ else
|
||||||
compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \
|
compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
else
|
else
|
||||||
_files
|
_files && ret=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
_files
|
_files && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef strip
|
#compdef strip
|
||||||
|
|
||||||
local curcontext=$curcontext state line ret=0
|
local curcontext=$curcontext state line ret=1
|
||||||
declare -A opt_args
|
declare -A opt_args
|
||||||
declare -a args
|
declare -a args
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ if _pick_variant gnu=GNU solaris --version; then
|
||||||
local expl
|
local expl
|
||||||
|
|
||||||
_description files expl 'command-line-options file'
|
_description files expl 'command-line-options file'
|
||||||
_files $expl && ret=0
|
_files "$expl[@]"
|
||||||
return $ret
|
return
|
||||||
fi
|
fi
|
||||||
args=(
|
args=(
|
||||||
'(-F --target)'{-F+,--target=}'[object code format to use]:bfd name:->bfdnames'
|
'(-F --target)'{-F+,--target=}'[object code format to use]:bfd name:->bfdnames'
|
||||||
|
@ -52,9 +52,9 @@ case $state in
|
||||||
local expl
|
local expl
|
||||||
declare -a bfdnames
|
declare -a bfdnames
|
||||||
|
|
||||||
bfdnames=(${=${(M)${(f)"$(_call_program bfdnames strip --help 2>/dev/null)"}:#strip: supported targets: *}#strip: supported targets: })
|
bfdnames=(${=${(M)${(f)"$(_call_program bfdnames strip --help)"}:#strip: supported targets: *}#strip: supported targets: })
|
||||||
_describe -t bfdnames 'bfd name' bfdnames && ret=0
|
_describe -t bfdnames 'bfd name' bfdnames && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return $ret
|
return ret
|
||||||
|
|
|
@ -132,9 +132,9 @@ _hosts_or_user_at_host()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (( CURRENT == 1 )); then
|
if (( CURRENT == 1 )); then
|
||||||
_describe -t commands 'systemctl command' _systemctl_cmds || compadd "$@"
|
_describe -t commands 'systemctl command' _systemctl_cmds
|
||||||
else
|
else
|
||||||
local curcontext="$curcontext"
|
local curcontext="$curcontext" ret
|
||||||
|
|
||||||
cmd="${${_systemctl_cmds[(r)$words[1]:*]%%:*}}"
|
cmd="${${_systemctl_cmds[(r)$words[1]:*]%%:*}}"
|
||||||
# Deal with any aliases
|
# Deal with any aliases
|
||||||
|
|
|
@ -12,8 +12,8 @@ if (( ! $+_telnet_args )); then
|
||||||
local help="$(_call_program options 'telnet -\?' < /dev/null 2>&1)"
|
local help="$(_call_program options 'telnet -\?' < /dev/null 2>&1)"
|
||||||
local -A optionmap
|
local -A optionmap
|
||||||
optionmap=(
|
optionmap=(
|
||||||
'*\[-4\]*' '-4[Force IPv4 address resolution]'
|
'*\[-4\]*' '-4[force IPv4 address resolution]'
|
||||||
'*\[-6\]*' '-6[Force IPv6 address resolution]'
|
'*\[-6\]*' '-6[force IPv6 address resolution]'
|
||||||
'*\[-8\]*' '-8[allow 8-Bit data]'
|
'*\[-8\]*' '-8[allow 8-Bit data]'
|
||||||
'*\[-E\]*' '-E[disable an escape character]'
|
'*\[-E\]*' '-E[disable an escape character]'
|
||||||
'*\[-K\]*' '-K[no automatic login]'
|
'*\[-K\]*' '-K[no automatic login]'
|
||||||
|
@ -52,16 +52,16 @@ _arguments -C -s \
|
||||||
case "$state" in
|
case "$state" in
|
||||||
ssl)
|
ssl)
|
||||||
_values -w 'SSL parameter' \
|
_values -w 'SSL parameter' \
|
||||||
'debug[Send SSL debugging info to stderr]' \
|
'debug[send SSL debugging info to stderr]' \
|
||||||
'(nossl)ssl[Negotiate SSL connection]' \
|
'(nossl)ssl[negotiate SSL connection]' \
|
||||||
'(ssl)nossl[Switch off SSL negotiation]' \
|
'(ssl)nossl[switch off SSL negotiation]' \
|
||||||
'certrequired[Require server certificate]' \
|
'certrequired[require server certificate]' \
|
||||||
'secure[No fallback to unencrypted mode]' \
|
'secure[no fallback to unencrypted mode]' \
|
||||||
'verbose[Be verbose about certificates, etc.]' \
|
'verbose[be verbose about certificates, etc.]' \
|
||||||
'verify[Set SSL verify flags]:int:' \
|
'verify[set SSL verify flags]:int' \
|
||||||
'cert[Specify certificate file]:certificate file:_path_files' \
|
'cert[specify certificate file]:certificate file:_path_files' \
|
||||||
'key[Specify key file]:key file:_path_files' \
|
'key[specify key file]:key file:_path_files' \
|
||||||
'cipher[Set preferred cipher list]:ciphers:'
|
'cipher[set preferred cipher list]:cipher' && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
hosts)
|
hosts)
|
||||||
|
|
|
@ -123,6 +123,4 @@ _arguments \
|
||||||
'--css-prefix:CSS class name:' \
|
'--css-prefix:CSS class name:' \
|
||||||
'--accessibility-check:priority level:(${access[@]})' \
|
'--accessibility-check:priority level:(${access[@]})' \
|
||||||
'--newline:newline character:(LF CRLF CR)' \
|
'--newline:newline character:(LF CRLF CR)' \
|
||||||
'*:file:_files' && return
|
'*:file:_files'
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
|
@ -1490,7 +1490,7 @@ function __tmux-windows() {
|
||||||
# And here is the actual _tmux(), that puts it all together:
|
# And here is the actual _tmux(), that puts it all together:
|
||||||
function _tmux() {
|
function _tmux() {
|
||||||
local curcontext="${curcontext}"
|
local curcontext="${curcontext}"
|
||||||
local mode state ret
|
local mode state ret=1
|
||||||
local -a args
|
local -a args
|
||||||
local -x tmuxcommand
|
local -x tmuxcommand
|
||||||
unset tmux_describe
|
unset tmux_describe
|
||||||
|
@ -1508,22 +1508,22 @@ function _tmux() {
|
||||||
'-v[request verbose logging]'
|
'-v[request verbose logging]'
|
||||||
'*:: :->subcommand_or_options'
|
'*:: :->subcommand_or_options'
|
||||||
)
|
)
|
||||||
_arguments -C -s -w ${args} && return
|
_arguments -C -s -w ${args} && ret=0
|
||||||
|
|
||||||
if [[ ${state} == "subcommand_or_options" ]]; then
|
if [[ ${state} == "subcommand_or_options" ]]; then
|
||||||
if (( CURRENT == 1 )) ; then
|
if (( CURRENT == 1 )) ; then
|
||||||
zstyle -s ":completion:${curcontext}:subcommands" mode mode || mode='both'
|
zstyle -s ":completion:${curcontext}:subcommands" mode mode || mode='both'
|
||||||
if [[ ${mode} == 'commands' ]]; then
|
if [[ ${mode} == 'commands' ]]; then
|
||||||
_describe -t subcommands 'tmux commands' _tmux_commands
|
_describe -t subcommands 'tmux commands' _tmux_commands && ret=0
|
||||||
elif [[ ${mode} == 'aliases' ]]; then
|
elif [[ ${mode} == 'aliases' ]]; then
|
||||||
_describe -t subcommands 'tmux aliases' _tmux_aliases
|
_describe -t subcommands 'tmux aliases' _tmux_aliases && ret=0
|
||||||
else
|
else
|
||||||
_describe -t subcommands 'tmux commands and aliases' _tmux_commands -- _tmux_aliases
|
_describe -t subcommands 'tmux commands and aliases' _tmux_commands -- _tmux_aliases && ret=0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if (( ${+commands[tmux]} == 0 )); then
|
if (( ${+commands[tmux]} == 0 )); then
|
||||||
_message '`tmux'\'' not found in $path; sub-cmd completions disabled.'
|
_message '`tmux'\'' not found in $path; sub-cmd completions disabled.'
|
||||||
return 0
|
return
|
||||||
fi
|
fi
|
||||||
tmuxcommand="${words[1]}"
|
tmuxcommand="${words[1]}"
|
||||||
if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then
|
if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then
|
||||||
|
@ -1545,6 +1545,7 @@ function _tmux() {
|
||||||
_call_function ret _tmux-${tmuxcommand}
|
_call_function ret _tmux-${tmuxcommand}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
# description generation follows; only done on 1st _tmux call.
|
# description generation follows; only done on 1st _tmux call.
|
||||||
|
|
|
@ -1,60 +1,29 @@
|
||||||
#compdef vcsh
|
#compdef vcsh
|
||||||
|
|
||||||
function __vcsh_repositories () {
|
function __vcsh_repositories () {
|
||||||
local expl
|
|
||||||
local -a repos
|
local -a repos
|
||||||
repos=( ${(f)"$(command vcsh list)"} )
|
repos=( ${(f)"$(_call_program repositories vcsh list)"} )
|
||||||
_describe -t repos 'repositories' repos
|
_describe -t repositories 'repository' repos
|
||||||
}
|
|
||||||
|
|
||||||
function __vcsh_not_implemented_yet () {
|
|
||||||
_message "Subcommand completion '${1#*-}': not implemented yet"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _vcsh-clone () {
|
function _vcsh-clone () {
|
||||||
__vcsh_not_implemented_yet "$0" #TODO
|
_default #TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
function _vcsh-delete () {
|
local func
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
for func in help init list list-tracked pull push version; do
|
||||||
}
|
_vcsh-$func() { _nothing }
|
||||||
|
done
|
||||||
function _vcsh-enter () {
|
for func in delete enter list-tracked-by upgrade write-gitignore; do
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
_vcsh-$func() { (( CURRENT == 2 )) && __vcsh_repositories }
|
||||||
}
|
done
|
||||||
|
|
||||||
function _vcsh-help () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-init () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-list () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-list-tracked () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-list-tracked-by () {
|
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-pull () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-push () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-rename () {
|
function _vcsh-rename () {
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
case $CURRENT in
|
||||||
(( CURRENT == 3 )) && _message "new repository name"
|
2) __vcsh_repositories ;;
|
||||||
(( CURRENT > 3 )) && _nothing
|
3) _message "new repository name" ;;
|
||||||
|
*) _nothing ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function _vcsh-run () {
|
function _vcsh-run () {
|
||||||
|
@ -66,24 +35,8 @@ function _vcsh-run () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function _vcsh-upgrade () {
|
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-version () {
|
|
||||||
_nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-which () {
|
|
||||||
_files
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh-write-gitignore () {
|
|
||||||
(( CURRENT == 2 )) && __vcsh_repositories
|
|
||||||
}
|
|
||||||
|
|
||||||
function _vcsh () {
|
function _vcsh () {
|
||||||
local curcontext="${curcontext}"
|
local curcontext="${curcontext}" ret=1
|
||||||
local state vcshcommand
|
local state vcshcommand
|
||||||
local -a args subcommands
|
local -a args subcommands
|
||||||
|
|
||||||
|
@ -112,24 +65,25 @@ function _vcsh () {
|
||||||
'*:: :->subcommand_or_options_or_repo'
|
'*:: :->subcommand_or_options_or_repo'
|
||||||
)
|
)
|
||||||
|
|
||||||
_arguments -C ${args} && return
|
_arguments -C ${args} && ret=0
|
||||||
|
|
||||||
if [[ ${state} == "subcommand_or_options_or_repo" ]]; then
|
if [[ ${state} == "subcommand_or_options_or_repo" ]]; then
|
||||||
if (( CURRENT == 1 )); then
|
if (( CURRENT == 1 )); then
|
||||||
_describe -t subcommands 'vcsh sub-commands' subcommands
|
_describe -t subcommands 'vcsh sub-commands' subcommands && ret=0
|
||||||
__vcsh_repositories
|
__vcsh_repositories && ret=0
|
||||||
else
|
else
|
||||||
vcshcommand="${words[1]}"
|
vcshcommand="${words[1]}"
|
||||||
if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
|
if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
|
||||||
# There is no handler function, so this is probably the name
|
# There is no handler function, so this is probably the name
|
||||||
# of a repository. Act accordingly.
|
# of a repository. Act accordingly.
|
||||||
_dispatch git git
|
_dispatch git git && ret=0
|
||||||
else
|
else
|
||||||
curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
|
curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
|
||||||
_call_function ret _vcsh-${vcshcommand}
|
_call_function ret _vcsh-${vcshcommand}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
_vcsh "$@"
|
_vcsh "$@"
|
||||||
|
|
|
@ -12,7 +12,7 @@ _zpool() {
|
||||||
)
|
)
|
||||||
|
|
||||||
versions=(
|
versions=(
|
||||||
${${${(M)"${(f)$(zpool upgrade -v)}":#[[:space:]]#<->*}##[[:space:]]}%%[[:space:]]*}
|
${${${(M)"${(f)$(_call_program versions zpool upgrade -v)}":#[[:space:]]#<->*}##[[:space:]]}%%[[:space:]]*}
|
||||||
)
|
)
|
||||||
|
|
||||||
ro_props=(
|
ro_props=(
|
||||||
|
@ -87,15 +87,12 @@ _zpool() {
|
||||||
|
|
||||||
if [[ $service == "zpool" ]]; then
|
if [[ $service == "zpool" ]]; then
|
||||||
_arguments -C -A "-*" \
|
_arguments -C -A "-*" \
|
||||||
'-\?[Help]' \
|
'-\?[show help information]' \
|
||||||
'*::command:->subcmd' && return 0
|
'1:subcommand:compadd -a subcmds' \
|
||||||
|
'*:: :->subcmd' && return
|
||||||
|
|
||||||
if (( CURRENT == 1 )); then
|
|
||||||
_wanted commands expl "zpool subcommand" compadd -a subcmds
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
service="$words[1]"
|
service="$words[1]"
|
||||||
curcontext="${curcontext%:*}=$service:"
|
curcontext="${curcontext%:*}-$service:"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $service in
|
case $service in
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
local expl users
|
local expl users
|
||||||
|
|
||||||
if zstyle -a ":completion:${curcontext}:users" users users; then
|
if zstyle -a ":completion:${curcontext}:users" users users; then
|
||||||
_wanted users expl user compadd "$@" -a - users
|
_wanted users expl user compadd "$@" -a - users
|
||||||
return 0
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_wanted users expl user compadd "$@" -k - userdirs
|
_wanted users expl user compadd "$@" -k - userdirs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef rxvt urxvt urxvtc
|
#compdef rxvt urxvt urxvtc urxvt256c urxvt256cc urxvt256c-ml urxvt256c-mlc
|
||||||
|
|
||||||
local curcontext="$curcontext" state line expl
|
local curcontext="$curcontext" state line expl ret=1
|
||||||
local -a suf long_args
|
local -a suf long_args
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
typeset -U extensions
|
typeset -U extensions
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#compdef xdpyinfo xwininfo xkill xfontsel xfd xev xhost xon xsetroot xwd xwud xrdb xprop xlsatoms
|
#compdef xdpyinfo xwininfo xkill xfontsel xfd xev xhost xon xsetroot xwd xwud xrdb xprop xlsatoms
|
||||||
|
|
||||||
local ret=1 oret expl
|
local curcontext="$curcontext" state line expl ret=1
|
||||||
|
|
||||||
case "$service" in
|
case "$service" in
|
||||||
xdpyinfo)
|
xdpyinfo)
|
||||||
_x_arguments \
|
_x_arguments \
|
||||||
-queryExtensions \
|
-queryExtensions \
|
||||||
'-ext:extension: _x_extension -a'
|
'-ext:extension: _x_extension -a' \
|
||||||
|
-version
|
||||||
;;
|
;;
|
||||||
xwininfo)
|
xwininfo)
|
||||||
_x_arguments \
|
_x_arguments \
|
||||||
|
@ -16,7 +17,7 @@ xwininfo)
|
||||||
'(-name -root)-id:id: _x_window'
|
'(-name -root)-id:id: _x_window'
|
||||||
;;
|
;;
|
||||||
xprop)
|
xprop)
|
||||||
_x_arguments \
|
_x_arguments -C \
|
||||||
-{help,frame,notype,spy} \
|
-{help,frame,notype,spy} \
|
||||||
'-grammar[show grammar for command line options]' \
|
'-grammar[show grammar for command line options]' \
|
||||||
'(-id -name)-root[use the root window as the target window]' \
|
'(-id -name)-root[use the root window as the target window]' \
|
||||||
|
@ -28,16 +29,17 @@ xprop)
|
||||||
'*-remove[specify an atom to remove from the target window]:atoms:->atoms' \
|
'*-remove[specify an atom to remove from the target window]:atoms:->atoms' \
|
||||||
'*-set[specify an atom and a value to set on the target window]:atoms:->atoms:value' \
|
'*-set[specify an atom and a value to set on the target window]:atoms:->atoms:value' \
|
||||||
'*-f:atoms:->atoms:format: ::dformat' \
|
'*-f:atoms:->atoms:format: ::dformat' \
|
||||||
'*:atoms:->atoms' && ret=0
|
'*:atoms:->atoms'
|
||||||
;;
|
;;
|
||||||
xlsatoms)
|
xlsatoms)
|
||||||
_x_arguments \
|
_x_arguments -C \
|
||||||
'*-format[printf-style format to use]:format' \
|
'*-format[printf-style format to use]:format' \
|
||||||
'*-range[atom values to list]:[num]-[num]' \
|
'*-range[atom values to list]:[num]-[num]' \
|
||||||
'*-name[name of single atom to print]:atom:->atoms'
|
'*-name[name of single atom to print]:atom:->atoms'
|
||||||
;;
|
;;
|
||||||
xkill)
|
xkill)
|
||||||
_x_arguments \
|
_x_arguments \
|
||||||
|
-version \
|
||||||
-frame \
|
-frame \
|
||||||
'(-id)-all' \
|
'(-id)-all' \
|
||||||
'(-all)-id:window: _x_window' \
|
'(-all)-id:window: _x_window' \
|
||||||
|
@ -45,14 +47,16 @@ xkill)
|
||||||
;;
|
;;
|
||||||
xfontsel)
|
xfontsel)
|
||||||
_xt_arguments \
|
_xt_arguments \
|
||||||
-{print,noscaled} \
|
-{print,scaled} \
|
||||||
'-pattern:font pattern:_x_font' \
|
'-pattern:font pattern:_x_font' \
|
||||||
'-sample:sample text' \
|
'-sample:sample text' \
|
||||||
'-sample16:16-bit sample text'
|
'-sample16:16-bit sample text' \
|
||||||
|
'-sampleUCS:ISO10646 sample text'
|
||||||
;;
|
;;
|
||||||
xfd)
|
xfd)
|
||||||
_xt_arguments \
|
_xt_arguments \
|
||||||
'-fn:font: _x_font' \
|
'-fn:font: _x_font' \
|
||||||
|
'-fa:font: _xft_fonts' \
|
||||||
-{box,center} \
|
-{box,center} \
|
||||||
'-start:first character number' \
|
'-start:first character number' \
|
||||||
'-bc:box border color:_x_color' \
|
'-bc:box border color:_x_color' \
|
||||||
|
@ -66,7 +70,8 @@ xev)
|
||||||
'-id:id:_x_window' \
|
'-id:id:_x_window' \
|
||||||
'-s[use save-under]' \
|
'-s[use save-under]' \
|
||||||
'-name:window name' \
|
'-name:window name' \
|
||||||
'-rv'
|
'-rv' \
|
||||||
|
'*-event:event mask:(keyboard mouse expose visibility structure substructure focus property colormap owner_grab_button randr)'
|
||||||
;;
|
;;
|
||||||
xhost)
|
xhost)
|
||||||
local type tmp match
|
local type tmp match
|
||||||
|
@ -120,8 +125,8 @@ xhost)
|
||||||
'types:name family:compadd -S: - inet dnet nis krb' \
|
'types:name family:compadd -S: - inet dnet nis krb' \
|
||||||
'hosts:: _hosts' && ret=0
|
'hosts:: _hosts' && ret=0
|
||||||
fi
|
fi
|
||||||
return ret
|
|
||||||
fi
|
fi
|
||||||
|
return ret
|
||||||
;;
|
;;
|
||||||
xon)
|
xon)
|
||||||
_arguments \
|
_arguments \
|
||||||
|
@ -165,7 +170,7 @@ xwud)
|
||||||
;;
|
;;
|
||||||
xrdb)
|
xrdb)
|
||||||
_x_arguments \
|
_x_arguments \
|
||||||
-{help,quiet,symbols,retain} \
|
-{help,quiet,symbols,retain,version} \
|
||||||
'(-all -screen -screens)-global' \
|
'(-all -screen -screens)-global' \
|
||||||
'(-global -screen -screens)-all' \
|
'(-global -screen -screens)-all' \
|
||||||
'(-global -all -screens)-screen' \
|
'(-global -all -screens)-screen' \
|
||||||
|
@ -185,12 +190,10 @@ xrdb)
|
||||||
'*-I-:include directory:_files -/' \
|
'*-I-:include directory:_files -/' \
|
||||||
'*:defaults file:_files'
|
'*:defaults file:_files'
|
||||||
;;
|
;;
|
||||||
esac
|
esac && ret=0
|
||||||
|
|
||||||
oret=$?
|
|
||||||
if [[ $state == atoms ]]; then
|
if [[ $state == atoms ]]; then
|
||||||
_wanted atoms expl atoms compadd ${${(f)"$(_call_program atoms xlsatoms 2> /dev/null)"}#*$'\t'} && ret=0
|
_wanted atoms expl atoms compadd ${${(f)"$(_call_program atoms xlsatoms 2> /dev/null)"}#*$'\t'} && ret=0
|
||||||
else
|
|
||||||
ret=$oret
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Reference in a new issue