From 19f038b5fae9b1bec64495eaf8f1a1926716d0a9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 10 Oct 2014 17:03:59 +0200 Subject: 33420: complete -R/-m options and fix feature completion --- Completion/Zsh/Command/_zmodload | 42 +++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'Completion/Zsh') diff --git a/Completion/Zsh/Command/_zmodload b/Completion/Zsh/Command/_zmodload index ffcab28dd..e144b981e 100644 --- a/Completion/Zsh/Command/_zmodload +++ b/Completion/Zsh/Command/_zmodload @@ -4,35 +4,38 @@ local suf comp state line expl curcontext="$curcontext" ret=1 NORMARG typeset -A opt_args suf=() -_arguments -n -C -A "-*" -s \ - '(-i -u -d -a -b -c -I -p -f -e)-A[create module aliases]' \ - '-u[unload module]' \ - '(-e)-a[autoload module]' \ - '(-c -I -p -f)-b[autoload module for builtins]' \ - '(-b -I -p -f)-c[autoload module for condition codes]' \ - '(-i)-d[list or specify module dependencies]' \ - '(-i -u -d -a -b -c -p -f -L -A)-e[test if modules are loaded]' \ - '(-b -c -I -p)-f[autoload module for math functions]' \ - '(-u -b -c -p -f -A)-F[handle features]' \ +_arguments -n -C -S -s \ + '(-R -P -i -u -d -a -b -c -I -p -f -e -F -m)-A[create module aliases]' \ + '(-)-R[remove module aliases]' \ + '(-A -R -F -L -m -P -l -e)-u[unload module]' \ + '(-d -e -l)-a[autoload module]' \ + '(-c -d -I -p -f -F -P -l -m -A -R)-b[autoload module for builtins]' \ + '(-b -d -I -p -f -F -P -l -m -A -R)-c[autoload module for condition codes]' \ + '(-A -R -F -I -P -a -b -c -e -f -i -l -m -p)-d[list or specify module dependencies]' \ + '(-i -u -d -a -b -c -p -f -L -R)-e[test if modules are loaded]' \ + '(-b -c -d -I -p -F -P -l -m -A -R)-f[autoload module for math functions]' \ + '(-u -b -c -d -p -f -A -R -I)-F[handle features]' \ + '(-u -b -c -d -p -f -A -R -I)-m[treat feature arguments as patterns]' \ '(-d -e)-i[suppress error if command would do nothing]' \ - '(-b -c -p -f)-I[define infix condition names]' \ - '(-u -b -c -p -f -A)-l[list features]' \ + '(-b -c -d -p -f -F -P -m)-I[define infix condition names]' \ + '(-u -b -c -d -p -f -A -R)-l[list features]' \ '(-e -u)-L[output in the form of calls to zmodload]' \ - '(-b -c -I -f)-p[autoload module for parameters]' \ - '(-u -b -c -p -f -A)-P[array param for features]:array name:_parameters' \ - '*:params:->params' && ret=0 + '(-b -c -d -I -f -F -P -l -m -A -R)-p[autoload module for parameters]' \ + '(-u -b -c -d -p -f -A -R)-P[array param for features]:array name:_parameters' \ + '(-)*:params:->params' && ret=0 [[ $state = params ]] || return ret -(( $+opt_args[-A] )) && compset -P '*=' || suf=( -S '=' ) - +if (( $+opt_args[-A] )); then + compset -S '=*' || compset -P '*=' || suf=( -S '=' ) +fi if (( $+opt_args[-F] && CURRENT > NORMARG )); then local module=$words[NORMARG] local -a features if [[ $modules[$module] != loaded ]]; then - _message "features for unloaded module" + _message -e features "feature for unloaded module" else zmodload -lFP features $module if compset -P -; then @@ -41,6 +44,9 @@ if (( $+opt_args[-F] && CURRENT > NORMARG )); then elif compset -P +; then # only disabled features needed features=(${${features:#+*}##?}) + else + # complete opposite of current feature state, + is default + features=(${${features#-}/(#s)+/-}) fi _wanted features expl feature compadd -a features fi -- cgit v1.2.3 From 5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 21 Oct 2014 20:53:51 +0200 Subject: 33485: fixes for zstyle context handling --- ChangeLog | 15 ++++++ Completion/BSD/Command/_portsnap | 2 +- Completion/Darwin/Command/_defaults | 3 +- Completion/Darwin/Command/_fink | 7 +-- Completion/Debian/Command/_dchroot | 8 ++-- Completion/Debian/Command/_dchroot-dsa | 8 ++-- Completion/Debian/Command/_make-kpkg | 6 +-- Completion/Debian/Command/_update-alternatives | 2 +- Completion/Debian/Command/_vim-addons | 65 +++++++++++++------------- Completion/Unix/Command/_du | 12 ++--- Completion/Unix/Command/_ecasound | 28 +++++------ Completion/Unix/Command/_ffmpeg | 36 ++++++-------- Completion/Unix/Command/_ln | 25 ++++++---- Completion/Unix/Command/_mail | 6 +-- Completion/Unix/Command/_mosh | 3 +- Completion/Unix/Command/_mysqldiff | 3 -- Completion/Unix/Command/_od | 4 +- Completion/Unix/Command/_pgrep | 4 +- Completion/Unix/Command/_pydoc | 23 +++++---- Completion/Unix/Command/_ri | 4 +- Completion/Unix/Command/_su | 20 ++++++-- Completion/Zsh/Command/_tcpsys | 18 ++----- Completion/Zsh/Command/_zattr | 7 +-- 23 files changed, 164 insertions(+), 145 deletions(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 4387328cc..b1b2dc7aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2014-10-21 Oliver Kiddle + * 33485: Completion/BSD/Command/_portsnap, + Completion/Darwin/Command/_defaults, + Completion/Darwin/Command/_fink, Completion/Debian/Command/_dchroot, + Completion/Debian/Command/_dchroot-dsa, + Completion/Debian/Command/_make-kpkg, + Completion/Debian/Command/_update-alternatives, + Completion/Debian/Command/_vim-addons, Completion/Unix/Command/_du, + Completion/Unix/Command/_ecasound, Completion/Unix/Command/_ffmpeg, + Completion/Unix/Command/_ln, Completion/Unix/Command/_mail, + Completion/Unix/Command/_mosh, Completion/Unix/Command/_mysqldiff, + Completion/Unix/Command/_od, Completion/Unix/Command/_pgrep, + Completion/Unix/Command/_pydoc, Completion/Unix/Command/_ri, + Completion/Unix/Command/_su, Completion/Zsh/Command/_tcpsys, + Completion/Zsh/Command/_zattr: fixes for zstyle context handling + * 33481: Completion/Mandriva/Command/_rebootin, Completion/Unix/Type/_directories, Completion/Unix/Type/_pdf, Completion/Unix/Type/_pids, Completion/openSUSE/Command/_yast, diff --git a/Completion/BSD/Command/_portsnap b/Completion/BSD/Command/_portsnap index db71fbc60..0803a842e 100644 --- a/Completion/BSD/Command/_portsnap +++ b/Completion/BSD/Command/_portsnap @@ -1,6 +1,6 @@ #compdef portsnap -local context state line +local curcontext="$curcontext" state line typeset -A opt_args flags=( diff --git a/Completion/Darwin/Command/_defaults b/Completion/Darwin/Command/_defaults index 7818e0379..ca5d87e65 100644 --- a/Completion/Darwin/Command/_defaults +++ b/Completion/Darwin/Command/_defaults @@ -25,8 +25,9 @@ _defaults(){ _1st_arguments=( read read-type write rename delete domains find help ) local curcontext="$curcontext" state line expl + typeset -A opt_args - _arguments -A '-*' \ + _arguments -C -A '-*' \ '(-currentHost)-host:host:_hosts' \ '(-host)-currentHost' \ '*::command:->subcmd' && return 0 diff --git a/Completion/Darwin/Command/_fink b/Completion/Darwin/Command/_fink index 55c9e8da5..04a067ec1 100644 --- a/Completion/Darwin/Command/_fink +++ b/Completion/Darwin/Command/_fink @@ -86,7 +86,7 @@ _fink(){ 'cleanup:removes obsolete package files' ) - local context state line expl + local curcontext="$curcontext" state line expl local -A opt_args _arguments \ @@ -136,8 +136,8 @@ _fink(){ '(-t --tab)'{-t,--tab}'[output the list with tabs as field delimiter]' \ '(-w --width)'{-w=,--width=}'[width of display]:number or "auto"' \ '(1 : -)'{-h,--help}'[display help text]' \ - '1: :->pkgs' && return 0 - + '1: :->pkgs' && return + if [[ "$state" == pkgs ]]; then _fink_get_packages _wanted packages expl 'package hint' compadd -a packages @@ -161,6 +161,7 @@ _fink(){ #scanpackages) #checksums) #cleanup) + *) _default ;; esac } diff --git a/Completion/Debian/Command/_dchroot b/Completion/Debian/Command/_dchroot index 43a797d83..c26e5691a 100644 --- a/Completion/Debian/Command/_dchroot +++ b/Completion/Debian/Command/_dchroot @@ -20,8 +20,8 @@ _arguments -S \ '*::arguments: _normal' && return 0 case "$state" in - (chroot) - _wanted tag expl 'chroot' \ - compadd ${(os:,:)${${${"$(dchroot -l )"#*: }// /}//[[\]]/,}} - ;; + chroot) + _wanted -C $context chroots expl 'chroot' \ + compadd ${(os:,:)${${${"$(_call_program chroots dchroot -l )"#*: }// /}//[[\]]/,}} + ;; esac diff --git a/Completion/Debian/Command/_dchroot-dsa b/Completion/Debian/Command/_dchroot-dsa index bed4bcf19..d4668b553 100644 --- a/Completion/Debian/Command/_dchroot-dsa +++ b/Completion/Debian/Command/_dchroot-dsa @@ -19,8 +19,8 @@ _arguments -S \ '*::arguments: _normal' && return 0 case "$state" in - (chroot) - _wanted tag expl 'chroot' \ - compadd ${(os:,:)${${${"$(dchroot -l )"#*: }// /}//[[\]]/,}} - ;; + chroot) + _wanted -C $context chroots expl 'chroot' \ + compadd ${(os:,:)${${${"$(_call_program chroots dchroot -l )"#*: }// /}//[[\]]/,}} + ;; esac diff --git a/Completion/Debian/Command/_make-kpkg b/Completion/Debian/Command/_make-kpkg index c079d9aa0..55adf882f 100644 --- a/Completion/Debian/Command/_make-kpkg +++ b/Completion/Debian/Command/_make-kpkg @@ -1,9 +1,9 @@ #compdef make-kpkg -local context state line +local curcontext="$curcontext" state line typeset -A opt_args -_arguments \ +_arguments -C \ '--help[display help message]' \ '--revision[change Debian revision number]:number:' \ '--append-to-version[specify additional kernel sub-version]:suffix:' \ @@ -45,7 +45,7 @@ _arguments \ configure\:"configure the kernel" \ debian\:"creates the debian/ directory" \ libc-kheaders\:"create the kernel headers package needed by libc" \ - ))' && return 0 + ))' && return case "$state" in (addedmodules) diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives index ccf5084bf..31128dd82 100644 --- a/Completion/Debian/Command/_update-alternatives +++ b/Completion/Debian/Command/_update-alternatives @@ -1,6 +1,6 @@ #compdef update-alternatives -local curcontext="$curcontext" context state line alterdir +local curcontext="$curcontext" state line alterdir ret if [[ -d /var/lib/dpkg/alternatives ]]; then alterdir=/var/lib/dpkg/alternatives diff --git a/Completion/Debian/Command/_vim-addons b/Completion/Debian/Command/_vim-addons index dbd0ee31d..0ad39955d 100644 --- a/Completion/Debian/Command/_vim-addons +++ b/Completion/Debian/Command/_vim-addons @@ -1,47 +1,48 @@ #compdef vim-addons -local state line cmds ret=1 +local context state line expl ret=1 typeset -A opt_args -_arguments -C \ - {-q,--query}'[be quiet and make the output more parseable]' \ - {-r,--registry-dir}'[set the registry directory]' \ - {-s,--source-dir}'[set addon source directory]' \ - {-t,--target-dir}'[set addon target directory]' \ - {-v,--verbose}'[increase verbosity]' \ - {-y,--system-dir}'[set system-wide target directory]' \ - {-h,--help}'[help]' \ - {-w,--system-wide}'[set target directory to the system-wide one (overrides -t)]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - +_arguments \ + '(-q --query)'{-q,--query}'[be quiet and make the output more parseable]' \ + '(-r --registry-dir)'{-r,--registry-dir}'[set the registry directory]' \ + '(-s --source-dir)'{-s,--source-dir}'[set addon source directory]' \ + '(-t --target-dir -w --system-wide)'{-t,--target-dir}'[set addon target directory]' \ + '(-v --verbose -z --silent)'{-v,--verbose}'[increase verbosity]' \ + '(y --system-dir)'{-y,--system-dir}'[set system-wide target directory]' \ + '(-)'{-h,--help}'[show help information]' \ + '(-w --system-wide -t --target-dir)'{-w,--system-wide}'[use system-wide target directory]' \ + '(-z --silent -v --verbose)'{-z,--silent}'[supress most output]' \ + '1:commands:(( + install\:install\ specified\ addons + remove\:remove\ specified\ addons + list\:list\ available\ addons\ in\ registry + status\:list\ status\ of\ addons + disable\:disable\ specified\ addons + enable\:undo\ effects\ of\ previous\ disable + files\:list\ files\ composing\ the\ specified\ addon + show\:display\ detailed\ information\ on\ specified\ addon + ))' \ + '*: :->args' && ret=0 + case $state in - cmds) - cmds=( - 'install:install the specified addon' - 'remove:remove the specified addon' - 'list:list available addons in registry' - 'status:list the status of addons' - 'disable:disable the specified addons' - 'amend:under the effects of the previous disable' - 'files:list the files composing the specified addon' - 'show:display detailed information about the specified addon' - ) - _describe -t commands 'vim-addons command' cmds && ret=0 - ;; args) case $line[1] in install) - _wanted addon expl 'addon' compadd $(command vim-addons -q | awk '$2 == "removed" { print $1 }') && ret=0 + _wanted -C $context addons expl 'addon' compadd - \ + ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*removed}%$'\t'*} && ret=0 ;; - amend) - _wanted addon expl 'addon' compadd $(command vim-addons -q | awk '$2 == "disabled" { print $1 }') && ret=0 + enable) + _wanted -C $context addons expl 'addon' compadd - \ + ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*disabled}%$'\t'*} && ret=0 ;; remove) - _wanted addon expl 'addon' compadd $(command vim-addons -q | awk '$2 ~ /disabled|installed/ { print $1 }') && ret=0 + _wanted -C $context addons expl 'addon' compadd - \ + ${${(M)${(f)"$(_call_program addons vim-addons -q)"}:#*(disabled|installed)}%$'\t'*} && ret=0 ;; - files|status|disable|show) - _wanted addon expl 'addon' compadd $(command vim-addons list) && ret=0 + *) + _wanted -C $context addons expl 'addon' compadd - \ + $(_call_program addons vim-addons list) && ret=0 ;; esac ;; diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du index 9ae6e9cb3..8b053ba4d 100644 --- a/Completion/Unix/Command/_du +++ b/Completion/Unix/Command/_du @@ -1,7 +1,7 @@ #compdef du if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then - local ret=1 + local context state line expl ret=1 _arguments -s \ '(-a --all -s --summarize)'{-a,--all}'[write counts for all files]' \ @@ -24,7 +24,7 @@ if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then \*{-X+,--exclude-from=}'[exclude files matching any pattern in file]:file:_files' \ '*--exclude=[exclude files matching pattern]:pattern' \ '(-s --summarize)--max-depth=[maximum levels to recurse]:levels' \ - '--files0-from=[use NUL-terminated list of files from file]:file' \ + '--files0-from=[use NUL-terminated list of files from file]:file:_files' \ '--time-style=[show times using given style, +FORMAT for strftime formatted args]:style:->timestyle' \ '--time=-[show time of last modification of any file in the directory]:property:->time' \ '(* -)--help[display help information]' \ @@ -35,14 +35,14 @@ if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then (time) local -a property property=(atime access use ctime status) - _wanted property expl property compadd -a property && ret=0 - ;; + _wanted -C $context property expl property compadd -a property && ret=0 + ;; (timestyle) local -a style desc style=(full-iso long-iso iso +) desc=('full-iso' 'long-iso' 'iso' '+FORMAT like `date'\''') - _wanted -V style expl style compadd -d desc -a style && ret=0 - ;; + _wanted -C $context -V style expl style compadd -d desc -a style && ret=0 + ;; esac return ret diff --git a/Completion/Unix/Command/_ecasound b/Completion/Unix/Command/_ecasound index e31b072f9..7ad08d0e1 100644 --- a/Completion/Unix/Command/_ecasound +++ b/Completion/Unix/Command/_ecasound @@ -1,9 +1,9 @@ #compdef ecasound -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args -_arguments \ +_arguments -C \ '-c[start in interactive mode]' \ '(-q)-d\:-[debug level]:debug level' \ '-D[print all debug information to stderr]' \ @@ -53,7 +53,7 @@ _arguments \ '*-eli\:-[LADSPA Plugin]: :->el' \ '*-gc\:-[time crop gate]: :->gc' \ '*-ge\:-[threshold gate]: :->ge' \ - && return 0 + ':input source:->io' && ret=0 case $state in filters) @@ -82,12 +82,12 @@ case $state in 'r[reverb effect]: :->etr' ;; emod) - _values -S : 'envelopme modulation' \ + _values -S : 'envelope modulation' \ 'b[pulse gate]: :->eemb' \ 'p[pulse gate (hz)]: :->eemp' \ 't[tremolo effect]: :->eemt' ;; -esac +esac && ret=0 case $state in b) @@ -173,12 +173,12 @@ case $state in typeset -A msgs local str msgs=( - eac 'amplification value (percent):channel' - eaw 'amplification value (percent):channel:max-clipped-samples' - ec 'compression rate (decibels):threshold (0.0-1.0)' - eca 'peak-level:release-time (seconds):fast compression rate (0.0-1.0):compression rate' - enm 'threshold-level:pre-hold-time (msec):attack-time (msec):post-hold-time (msec):release-time (msec)' - ezx 'left DC fix value:right CD fix value' + eac 'amplification value (percent):channel' + eaw 'amplification value (percent):channel:max-clipped-samples' + ec 'compression rate (decibels):threshold (0.0-1.0)' + eca 'peak-level:release-time (seconds):fast compression rate (0.0-1.0):compression rate' + enm 'threshold-level:pre-hold-time (msec):attack-time (msec):post-hold-time (msec):release-time (msec)' + ezx 'left DC fix value:right CD fix value' eemb 'pulse frequency (beats per minute):on time (msec)' eemp 'pulse frequency (hz):on time (percent)' eemt 'tremolo speed (beats per second):depth (percent)' @@ -206,5 +206,7 @@ case $state in str="${str#*:}" done _message "${str%%:*}" - ;; -esac + ;; +esac && ret=0 + +return ret diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg index 6a4ba234d..d68a094d4 100644 --- a/Completion/Unix/Command/_ffmpeg +++ b/Completion/Unix/Command/_ffmpeg @@ -1,6 +1,6 @@ #compdef ffmpeg -local context state line expl +local curcontext="$curcontext" state line expl typeset -A opt_args (( $+functions[_ffmpeg_presets] )) || _ffmpeg_presets() { @@ -33,14 +33,10 @@ typeset -A opt_args _wanted ffmpeg-formats expl 'force format' compadd -a formats } -(( $+functions[_ffmpeg_list_pix_fmts] )) || _ffmpeg_list_pix_fmts() { - echo - ${${${(M)${(f)"$(_call_program formats $words[1] -pix_fmts 2>/dev/null)"}:#[I.][O.][H.][P.][B.] [^=[:space:]]*}#* }%% *} -} - (( $+functions[_ffmpeg_pix_fmts] )) || _ffmpeg_pix_fmts() { local pix_fmts - pix_fmts=($(_ffmpeg_list_pix_fmts)) - _wanted ffmpeg-pix-fmts expl 'set pixel format' compadd -a pix_fmts + _wanted ffmpeg-pix-fmts expl 'pixel format' compadd "$@" - \ + ${${${(M)${(f)"$(_call_program formats $words[1] -pix_fmts 2>/dev/null)"}:#[I.][O.][H.][P.][B.] [^=[:space:]]*}#* }%% *} } (( $+functions[_ffmpeg_bsfs] )) || _ffmpeg_bsfs() { @@ -71,10 +67,10 @@ typeset -A _ffmpeg_flags local match mbegin mend integer ret=1 - if [[ $PREFIX = (#b)(*)[-+]([^-+]#) ]]; then + if [[ $PREFIX = (#b)(*)[-+]([^-+]#) ]]; then if [[ -n ${flag_options[(R)$match[2]]} ]]; then _ffmpeg_new_flag_options && ret=0 - fi + fi if [[ -n ${flag_options[(R)$match[2]?*]} ]]; then _ffmpeg_more_flag_options ${#match[1]} && ret=0 fi @@ -82,7 +78,7 @@ typeset -A _ffmpeg_flags _ffmpeg_flag_options && ret=0 fi - return $ret + return ret } (( $+functions[_ffmpeg_register_lastopt_values] )) || _ffmpeg_register_lastopt_values() { @@ -150,7 +146,7 @@ local -a _ffmpeg_argspecs elif [[ $lastopt == -pix_fmt ]]; then lastopt_takesargs=0 lastopt="*$lastopt" - lastopt+=": :_ffmpeg_pix_fmts" + lastopt+=":set pixel format:_ffmpeg_pix_fmts" elif [[ $example == bitstream_filter ]]; then lastopt_takesargs=0 lastopt+=": :_ffmpeg_bsfs" @@ -175,17 +171,17 @@ local -a _ffmpeg_argspecs [[ -n $lastopt ]] && _ffmpeg_register_lastopt_values } -_arguments -S \ +_arguments -C -S \ "${_ffmpeg_argspecs[@]}" \ '*:output file:_files' \ - && return 0 + && return [[ "$state" == "vfilters" ]] && _values -s , -S = 'video filters' \ 'aspect:set aspect ratio (rational number X\:Y or decimal number):' \ 'crop:crop input video (x\:y\:width\:height):' \ - 'format: :->format' \ - 'noformat: :->noformat' \ + 'format: :_sequence -s : _ffmpeg_pix_fmts' \ + 'noformat: :_sequence -s : _ffmpeg_pix_fmts' \ 'null' \ 'pad:add pads to the input image (width\:height\:x\:y\:color_string):' \ 'pixelaspect:set pixel aspect ratio (rational number X\:Y or decimal number):' \ @@ -196,15 +192,9 @@ _arguments -S \ 'buffer' \ 'nullsrc' \ 'nullsink' \ - && return 0 - -[[ "$state" == "format" ]] && - _values -s : -S = 'convert input video to one of the specified pixel formats' $(_ffmpeg_list_pix_fmts) && return 0 - -[[ "$state" == "noformat" ]] && - _values -s : -S = 'disable specified pixel formats by force' $(_ffmpeg_list_pix_fmts) && return 0 + && return [[ -n $state && -n $_ffmpeg_flags[$state] ]] && - _ffmpeg_flags $state && return 0 + _ffmpeg_flags $state && return return 1 diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 89b7177ab..12baf76a9 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -3,10 +3,17 @@ local curcontext="$curcontext" state line ret=1 local -A opt_args -local -a args +local -a args bsd args=( '-f[remove existing destination files]' - '-s[create symbolic links instead of hard links]') + '-s[create symbolic links instead of hard links]' +) +bsd=( + '-F[remove existing destination directories]' + {-h,-n}'[do not dereference destination]' + '-i[prompt before removing destination files]' + '-v[print name of each linked file]' +) local -a opts @@ -44,14 +51,16 @@ elif (( ${+builtins[ln]} )); then {-h,-n}'[do not dereference destination]' '-i[prompt before removing destination files]') elif [[ $OSTYPE == darwin* ]]; then - args+=( - '-F[remove existing destination directories]' - {-h,-n}'[do not dereference destination]' - '-i[prompt before removing destination files]' - '-v[print name of each linked file]') + args+=( $bsd ) +elif [[ $OSTYPE == freebsd* ]]; then + args+=( $bsd + '(-L)-P[create hard links directly to symbolic links]' + '(-P)-L[create hard links to symbolic link references]' + "-w[warn if source of a symbolic link doesn't currently exist]" + ) fi -_arguments -s $opts \ +_arguments -C -s $opts \ $args \ ':link target:_files' \ '*:: :->files' && ret=0 diff --git a/Completion/Unix/Command/_mail b/Completion/Unix/Command/_mail index 90c75359d..d618cf366 100644 --- a/Completion/Unix/Command/_mail +++ b/Completion/Unix/Command/_mail @@ -1,9 +1,9 @@ #compdef mail mailx=mail Mail=mail mush zmail nail=mail _arguments -s \ - '(-f -u)*-b[specify a BCC recipient]:BCC recipient:->userhost' \ - '(-f -u)*-c[specify a CC recipient]:CC recipient:->userhost' \ + '(-f -u)*-b[specify a BCC recipient]:BCC recipient:_email_addresses -n $service' \ + '(-f -u)*-c[specify a CC recipient]:CC recipient:_email_addresses -n $service' \ '(-b -c -u -s *)-f+[specify mail folder]:mailbox:_mailboxes' \ - '(-f -u)-s+[specify a subject]:subject:' \ + '(-f -u)-s+[specify a subject]:subject' \ "(-b -c -f -s *)-u+[read specified user's mail]:user:_users" \ "(-f -u)*:recipient:_email_addresses -n $service" diff --git a/Completion/Unix/Command/_mosh b/Completion/Unix/Command/_mosh index dacbd1018..c19f6ebde 100644 --- a/Completion/Unix/Command/_mosh +++ b/Completion/Unix/Command/_mosh @@ -1,9 +1,8 @@ #compdef mosh local curcontext="$curcontext" state line -local -a suf -_arguments \ +_arguments -C \ '(-)--help[display help information]' \ '(-)--version[display version information]' \ "--no-init[don't set terminal init string]" \ diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff index 094694d32..4b46c86df 100644 --- a/Completion/Unix/Command/_mysqldiff +++ b/Completion/Unix/Command/_mysqldiff @@ -1,8 +1,5 @@ #compdef mysqldiff -local curcontext="$curcontext" state line expl -typeset -A opt_args - _mysqldiff () { _arguments -s \ {-h{,1,2},--host{,1,2}=}':server hostname:_mysql_hosts' \ diff --git a/Completion/Unix/Command/_od b/Completion/Unix/Command/_od index d542597e0..36a9b7dae 100644 --- a/Completion/Unix/Command/_od +++ b/Completion/Unix/Command/_od @@ -1,6 +1,6 @@ #compdef od -local context state state_descr line args ret=1 +local curcontext="$curcontext" state state_descr line args ret=1 local -A opt_args args=( @@ -49,7 +49,7 @@ else esac fi -_arguments -s -S : "$args[@]" && return 0 +_arguments -C -s -S : "$args[@]" && return 0 case "$state" in (format) diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 95d0ea284..3af55a379 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -1,6 +1,6 @@ #compdef pgrep pkill -local context state line ret=1 expl +local curcontext="$curcontext" state line ret=1 expl typeset -A opt_args typeset -a arguments @@ -66,7 +66,7 @@ esac arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*} '*:process name:->pname') -_arguments -s -w $arguments && ret=0 +_arguments -C -s -w $arguments && ret=0 case $state in (tty) diff --git a/Completion/Unix/Command/_pydoc b/Completion/Unix/Command/_pydoc index 92a01a76f..f85ab0c2d 100644 --- a/Completion/Unix/Command/_pydoc +++ b/Completion/Unix/Command/_pydoc @@ -1,16 +1,19 @@ #compdef pydoc -local context state line +local context state line ret=1 typeset -A opt_args _arguments \ - '-k[keyword]:keyword:' \ - '-p[port]:port:_ports' \ - '-g[gui]' \ - '-w[write out HTML]:file or dir:_files' \ - ':keyword, topic, module, package, or dotted reference:->lookup' && return 0 + '(-)-k[search keyword]:keyword' \ + '(- *)-p[start web server on specified port]:port number' \ + '(- *)-g[start gui]' \ + '(-)-w[write out HTML]:file or dir:_files' \ + '(- *)-h[show help information]' \ + '*: :->lookup' && ret=0 -_alternative \ - 'keywords:keyword:compadd ${=${${(f)"$(pydoc keywords)"}[2,-1]}}' \ - 'topics:topic:compadd ${=${${(f)"$(pydoc topics)"}[2,-1]}}' \ - 'modules:module:' +[[ -n $state ]] && _alternative -C $context \ + 'keywords:keyword:compadd ${=${${(f)"$(_call_program keywords pydoc keywords)"}[2,-1]}}' \ + 'topics:topic:compadd ${=${${(f)"$(_call_program topics pydoc topics)"}[2,-1]}}' \ + 'modules:module:' && ret=0 + +return ret diff --git a/Completion/Unix/Command/_ri b/Completion/Unix/Command/_ri index feb10ec91..070f46ac2 100644 --- a/Completion/Unix/Command/_ri +++ b/Completion/Unix/Command/_ri @@ -3,7 +3,7 @@ local curcontext="$curcontext" state line ret=1 typeset -A opt_args -_arguments \ +_arguments -C \ '(- *)'{-h,--help}'[print help information and exit]' \ '(- *)'{-v,--version}'[display the version of ri]' \ '*'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \ @@ -42,8 +42,6 @@ if [[ "$state" = ri-name ]]; then if compset -P '?*(::|\#|.)'; then class_dir=${IPREFIX//(::|\#|.)/\/} - #else - # : fi esc_name=${${(Q)PREFIX}//(#b)([^A-Za-z0-9_])/$(printf %%%x ${(qq)match[1]})} diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su index 6d0f2cd9f..9d3f28066 100644 --- a/Completion/Unix/Command/_su +++ b/Completion/Unix/Command/_su @@ -1,9 +1,9 @@ #compdef su local -A opt_args -local -a args state context +local -a args context state line expl local shell=${words[(i)(-s|--shell=*)]} first='1:user name:_users' -local usr=root line +local usr=root if _pick_variant gnu="Free Software Foundation" unix --version; then args=( @@ -20,10 +20,20 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then ) else args=( - '-c[pass command to shell]:command string:->command' '-l[use a login shell]' '-s[run the specified shell]:shell:->shell' ) + case $OSTYPE in + freebsd*) + args=( + '-c[use settings from specified login class]:class' + '-f[if the invoked shell is csh, prevent it from reading .cshrc]' + '-l[use a login shell]' + '-m[do not reset environment]' + '-s[set the MAC label]' + ) + *) args+=( '-c[pass command to shell]:command string:->command' ) ;; + esac fi if [[ $#words -ge 2 && $words[2] != -* && CURRENT -ne 2 ]]; then @@ -50,11 +60,11 @@ case $state in return ;; (shell) - compadd ${(f)^"$(fd' - '(-a -s -l)-f[open session for accept on fd]:fd:->fd' + '(-f -s -l)-a[open session for accept on fd]:fd' + '(-a -s -l)-f[open session for accept on fd]:fd' '-q[quiet mode]' '-z[no zle handler]' ) @@ -19,7 +19,7 @@ case $service in elif [[ -n $words[(R)-(l|s)*] ]]; then argargs+=('*:session:->session') else - argargs+=(':host:->host' ':port:->port' '*:session:->session') + argargs+=(':host:_hosts' ':port:_ports' '*:session:->session') fi _arguments -C $argargs ;; @@ -27,14 +27,6 @@ esac while (( $#state )); do case "$state[1]" in - (host) - _hosts - ;; - - (port) - _ports - ;; - (sessionlist) compset -P '*,' ;& diff --git a/Completion/Zsh/Command/_zattr b/Completion/Zsh/Command/_zattr index 1924bb28d..73564172b 100644 --- a/Completion/Zsh/Command/_zattr +++ b/Completion/Zsh/Command/_zattr @@ -1,7 +1,6 @@ #compdef zgetattr zsetattr zdelattr zlistattr -local state line expl ret=1 REPLY -local -a args privs +local context state line expl ret=1 REPLY case $service in zgetattr) @@ -30,5 +29,7 @@ esac && ret=0 if [[ $state = attrs ]]; then zlistattr ${~${(Q)line[1]}} REPLY 2> /dev/null - _wanted attrs expl 'attribute' compadd $REPLY + _wanted -C "$context[1]" attrs expl 'attribute' compadd -a REPLY && ret=0 fi + +return ret -- cgit v1.2.3 From 908abba89147f8a4e4991c4464a95ee90d1078f6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 6 Dec 2014 10:55:30 +0000 Subject: 33883: documentation for (*) glob qualifier --- ChangeLog | 8 +++++++- Completion/Zsh/Type/_globquals | 2 +- Doc/Zsh/expn.yo | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index f86b3a0fe..967f51684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ +2014-12-07 Peter Stephenson + + * Daniel Shahaf: 33883: Doc/Zsh/expn.yo, + Completion/Zsh/Type/_globquals: documentation for (*) glob + qualifier. + 2014-12-07 Jun-ichi Takimoto - * 33829: Test/X02zlevi.ztst, Test/comptest: unbind ESC~ as + * 33829: Test/X02zlevi.ztst, Test/comptest: unbind ESC~ asa a more reliable workaround 2014-12-06 Mikael Magnusson diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 37db161d0..042b27400 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -213,7 +213,7 @@ case $state in ".:plain files" "@:symbolic links" "=:sockets" - "p:name pipes (FIFOS)" + "p:named pipes (FIFOs)" "*:executable plain files" "%:device files" "r:owner-readable" diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 5ed78f0c1..8728803e0 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -2388,7 +2388,7 @@ item(tt(p))( named pipes (FIFOs) ) item(tt(*))( -executable plain files (0100) +executable plain files (0100 or 0010 or 0001) ) item(tt(%))( device files (character or block special) -- cgit v1.2.3 From 89c692eafb78d4f5a7cf48dc8fc8ab3e5eb73abd Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 21 Dec 2014 22:23:06 +0100 Subject: 33977: don't complete widgets as first argument to bindkey --- ChangeLog | 5 +++++ Completion/Zsh/Command/_bindkey | 1 + 2 files changed, 6 insertions(+) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index c11e2dee3..055cf2f21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-21 Oliver Kiddle + + * Daniel Shahaf: 33977: Completion/Zsh/Command/_bindkey: + don't complete widgets as first argument to bindkey + 2014-12-19 Peter Stephenson * 34015: Src/params.c: back off yesterday's mess and diff --git a/Completion/Zsh/Command/_bindkey b/Completion/Zsh/Command/_bindkey index 045cba960..4c4aeda9d 100644 --- a/Completion/Zsh/Command/_bindkey +++ b/Completion/Zsh/Command/_bindkey @@ -26,6 +26,7 @@ _arguments -C -s -S \ '(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \ '(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \ '(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \ + '(-l -L -d -A -N -m -p -r -s):in-string' \ '(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0 case $state in -- cgit v1.2.3 From 54bfcf5af18fbb841118e51b6c5325872770b52b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 24 Jan 2015 08:05:02 +0000 Subject: _zstyle vcs_info: Unbreak branchformat completion The failure mode was: % zstyle ':vcs_info:*' branchformat "foobar% _values:compvalues:10: no multi-letter values with empty separator allowed --- ChangeLog | 3 +++ Completion/Zsh/Command/_zstyle | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 2ca32cec1..b6c0b5834 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ Functions/VCS_Info/Backends/VCS_INFO_get_data_hg: vcs_info hg: Support inactive bookmarks + * Completion/Zsh/Command/_zstyle: _zstyle vcs_info: Unbreak + branchformat completion + 2015-01-23 Jun-ichi Takimoto * 34335: _yum: fix bugs in _yum_all_pkgs diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index eb27117b2..c8e1c2be8 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -549,7 +549,7 @@ while (( $#state )); do compset -P '*%' _values -s '' 'format replacement' \ 'b[the current branch]' \ - 'r[current revision number]' \ + 'r[current revision number]' else _message -e formats 'vcs format' fi -- cgit v1.2.3 From 20953f53f083a72ce30ad39baa4e78c9402e45aa Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 24 Jan 2015 05:39:01 +0000 Subject: _zstyle vcs_info completion: Add missing styles --- ChangeLog | 3 +++ Completion/Zsh/Command/_zstyle | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index b6c0b5834..21ff7a4bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ * Completion/Zsh/Command/_zstyle: _zstyle vcs_info: Unbreak branchformat completion + * Completion/Zsh/Command/_zstyle: _zstyle vcs_info completion: Add + missing styles + 2015-01-23 Jun-ichi Takimoto * 34335: _yum: fix bugs in _yum_all_pkgs diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index c8e1c2be8..2ebae7132 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -20,6 +20,9 @@ _completers() { compadd "$@" "$disp[@]" - "$us${^list[@]}" } +_vcs_info_hooks() { + compadd - ${functions[(I)+vi-*]#+vi-} +} # Assoc array of styles; the values give the possible top-level # contexts: # c completion @@ -176,7 +179,10 @@ styles=( actionformats v:vcs-format branchformat v:branch-format nvcsformats v: + hgrevformat v:hgrev-format stgitformat v:stg-format + patch-format v:patch-format + nopatch-format v:patch-format max-exports v: enable v:vcs disable v:vcs @@ -190,7 +196,16 @@ styles=( use-server v:bool use-simple v:bool get-revision v:bool + get-mq v:bool + get-bookmarks v:bool + get-unapplied v:bool + debug v:bool + hooks v:_vcs_info_hooks use-prompt-escapes v:bool + use-quilt v:bool + quilt-standalone v:bool + quilt-patch-dir v:_directories + quiltcommand v:_command_names chpwd z:bool progress z:progress @@ -555,6 +570,17 @@ while (( $#state )); do fi ;; + (hgrev-format) + if [[ $PREFIX = *% ]]; then + compset -P '*%' + _values -s '' 'format replacement' \ + 'h[current revision hash (global)]' \ + 'r[current revision number (local)]' + else + _message -e formats 'vcs format' + fi + ;; + (stg-format) if [[ $PREFIX = *% ]]; then compset -P '*%' @@ -566,6 +592,22 @@ while (( $#state )); do fi ;; + (patch-format) + if [[ $PREFIX = *% ]]; then + compset -P '*%' + _values -s '' 'format replacement' \ + 'p[name of top-most patch (applied-string)]' \ + 'u[number of unapplied patches (unapplied-string)]' \ + 'n[number of applied patches]' \ + 'c[number of unapplied patches.]' \ + 'a[number of all patches]' \ + 'g[names of active mq guards (hg backend)]' \ + 'G[number of active mq guards (hg backend)]' + else + _message -e formats 'vcs format' + fi + ;; + (_*) ${=state[1]} $suf ;; -- cgit v1.2.3 From f972b023a20e9fb67b2693ab7c5936d5c545fe55 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 25 Jan 2015 18:22:53 +0100 Subject: 34373, 34374: update completion of builtin commands, modifiers, parameter and globbing flags --- ChangeLog | 13 ++++ Completion/Unix/Command/_chown | 2 +- Completion/Unix/Command/_ln | 2 +- Completion/Unix/Type/_directories | 2 +- Completion/Zsh/Command/_command | 15 ++--- Completion/Zsh/Command/_fc | 86 +++++++++++++++++++------ Completion/Zsh/Command/_typeset | 2 +- Completion/Zsh/Command/_unhash | 11 +--- Completion/Zsh/Command/_which | 3 +- Completion/Zsh/Command/_zle | 8 ++- Completion/Zsh/Command/_zstyle | 2 +- Completion/Zsh/Context/_brace_parameter | 110 ++++++++++++++++++-------------- Completion/Zsh/Context/_subscript | 2 +- Completion/Zsh/Type/_globflags | 11 +++- Completion/Zsh/Type/_history_modifiers | 1 + Doc/Zsh/builtins.yo | 2 +- 16 files changed, 179 insertions(+), 93 deletions(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 60bb7a8a4..f11eebe4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-01-25 Oliver Kiddle + + * 34373, 34374: Completion/Unix/Command/_chown, + Completion/Unix/Command/_ln, Completion/Unix/Type/_directories, + Completion/Zsh/Command/_command, Completion/Zsh/Command/_fc, + Completion/Zsh/Command/_typeset, Completion/Zsh/Command/_unhash, + Completion/Zsh/Command/_which, Completion/Zsh/Command/_zle, + Completion/Zsh/Command/_zstyle, Completion/Zsh/Context/_subscript, + Completion/Zsh/Type/_globflags, Doc/Zsh/builtins.yo, + Completion/Zsh/Context/_brace_parameter, + Completion/Zsh/Type/_history_modifiers: update completion of + builtin commands, modifiers, parameter and globbing flags + 2015-01-25 Daniel Shahaf * 34381: Doc/Zsh/contrib.yo: vcs_info: Documentation update diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index b4539315d..7a7e5911c 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -1,4 +1,4 @@ -#compdef chown chgrp +#compdef chown chgrp zf_chown=chown zf_chgrp=chgrp local curcontext="$curcontext" state line expl ret=1 local suf usr grp req deref args diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 12baf76a9..c903fee02 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -1,4 +1,4 @@ -#compdef ln gln +#compdef ln gln zf_ln local curcontext="$curcontext" state line ret=1 local -A opt_args diff --git a/Completion/Unix/Type/_directories b/Completion/Unix/Type/_directories index 702d31dc4..2125645fe 100644 --- a/Completion/Unix/Type/_directories +++ b/Completion/Unix/Type/_directories @@ -1,4 +1,4 @@ -#compdef rmdir dircmp -P -value-,*path,-default- +#compdef rmdir zf_rmdir dircmp -P -value-,*path,-default- local expl diff --git a/Completion/Zsh/Command/_command b/Completion/Zsh/Command/_command index 7cfb52c2f..4e2858676 100644 --- a/Completion/Zsh/Command/_command +++ b/Completion/Zsh/Command/_command @@ -1,14 +1,11 @@ #compdef command -local ret - # indicate if this is a precommand modifier [[ $service = command ]] && precommands+=(command) -if [[ CURRENT -ge 3 ]]; then - compset -n 2 - _normal && ret=0 -else - _path_commands "$@" && ret=0 -fi -return ret +_arguments \ + '-v[indicate result of command search]:*:command:_path_commands' \ + '-V[show result of command search in verbose form]:*:command:_path_commands' \ + '(-)-p[use default PATH to find command]' \ + ':command:_path_commands' \ + '*::arguments: _normal' diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc index 2af5980c2..133145670 100644 --- a/Completion/Zsh/Command/_fc +++ b/Completion/Zsh/Command/_fc @@ -1,21 +1,47 @@ #compdef fc history r +local curcontext="$curcontext" state state_descr line ret=1 +local list events num cmd +typeset -A opt_args local fc_common fc_hist fc_r +# hide any replacements from _arguments +local cur=${(M)#words[1,CURRENT-1]:#*=*} +words=( "${(@)words[1,CURRENT-1]:#*=*}" "${(@)words[CURRENT,-1]}" ) +(( CURRENT -= cur )) + fc_common=( + -s -S '(-A -R -W -I -p -P)-r[reverse order of the commands]' '(-A -R -W -I -e -p -P)-n[suppress line numbers]' - '(-A -R -W -I -p -P)*::commands:_command_names -e' ) +) + +if [[ -n ${words[(r)-[pa](|[ap])]} ]]; then + fc_common+=( + ':history file:_files' + ':history size:' + ':saved history size:' + ) + [[ -n ${words[(r)-(|a)p(|a)]} ]] || fc_common+='!-a:option:(-p)' +elif [[ -n ${words[(r)-*[ARWI]*]} ]]; then + fc_common+=( ':history file:_files' ) +else + fc_common=( -C "$fc_common[@]" + '(-)1:first event:->events' '2:last event:->events' + ) +fi fc_hist=( - '(-A -R -W -I -p -p)-m[treat first argument as a pattern]' - '(-A -R -W -I -e -f -E -i -t -p -P)-d[print time-stamps]' - '(-A -R -W -I -e -d -E -i -t -p -P)-f[mm/dd/yyyy format time-stamps]' - '(-A -R -W -I -e -d -f -i -t -p -P)-E[dd.mm.yyyy format time-stamps]' - '(-A -R -W -I -e -d -f -E -t -p -P)-i[yyyy-mm-dd format time-stamps]' - '(-A -R -W -I -e -d -f -E -i -p -P)-t[print time-stamps in specified format]:date format' - '(-A -R -W -I -e -p -P)-D[print elapsed times]' - '(- *)-p[push current history to stack]:history file:_files:history size: :saved history size' + '(-A -R -W -I -a -p -P 2)-m[treat argument as a pattern]' + '(-A -R -W -I -e -f -E -i -t -a -p -P)-d[print time-stamps]' + '(-A -R -W -I -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]' + '(-A -R -W -I -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]' + '(-A -R -W -I -e -d -f -E -t -a -p -P)-i[yyyy-mm-dd format time-stamps]' + '(-A -R -W -I -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]:date format' + '(-A -R -W -I -e -a -p -P)-D[print elapsed times]' + + '(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-a[with -p, automatically pop history on function return]' + '(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-p[push current history to stack]' '(- *)-P[pop history from stack]' ) @@ -23,18 +49,42 @@ fc_r='(-A -R -W -I -e)-l[list resulting commands on stdout]' case $service in history) - _arguments -s -S "$fc_common[@]" "$fc_hist[@]" && return 0 + _arguments "$fc_common[@]" "$fc_hist[@] && ret=0" ;; r) - _arguments -s -S "$fc_common[@]" "$fc_r" && return 0 + _arguments "$fc_common[@]" "$fc_r" && ret=0 ;; *) - _arguments -s -S \ - '(-A -R -W -I -l -n -d -f -E -i -D -p -P)-e[specify editor to invoke]:editor to invoke:_command_names -e' \ - '(-l -m -e -r -n -d -f -E -i -D -A -W -p -P *)-R[read history from file]:history file:_files' \ - '(-l -m -e -r -n -d -f -E -i -D -R -W -p -P *)-A[append history to file]:history file:_files' \ - '(-l -m -e -r -n -d -f -E -i -D -R -A -p -P *)-W[write history to file]:history file:_files' \ - '(-l -m -e -r -n -d -f -E -i -D -A -W -p -P *)-I[read/write new events only]:history file:_files' \ - "$fc_common[@]" "$fc_hist[@]" "$fc_r" && return 0 + _arguments "$fc_common[@]" "$fc_hist[@]" "$fc_r" \ + '(-A -R -W -I -a -l -n -d -f -E -i -r -t -D -p -P)-e+[specify editor to invoke]:editor to invoke:_command_names -e' \ + '(-a -l -m -e -r -n -d -f -t -E -i -R -D -A -W -p -P *)-'{\ +'R[read history from file]',\ +'A[append history to file]',\ +'W[write history to file]',\ +'I[read/write new events only]'} && ret=0 ;; esac + +if [[ -n $state ]]; then + if [[ -z ${line:#*=*} ]] && compset -P '*='; then + _message -e replacements 'replacement' + elif [[ -prefix [0-9] ]]; then + events=( ${(ps.\0.)"$(printf '%s:%s\0' ${(kv)history})"} ) + zformat -a list " -- " "$events[@]" + _wanted -2V events expl "$state_descr" compadd -M "B:0=" -ld list - \ + "${events[@]%%:*}" + elif [[ -prefix - ]]; then + for num cmd in ${(kv)history}; do + (( num=num - HISTNO )) + events+=( $num:$cmd ) + done + zformat -a list " -- " "$events[@]" + _wanted -2V events expl "$state_descr" compadd -ld list - \ + "${events[@]%%:*}" + else + _wanted events expl "$state_descr" compadd -S '' - \ + ${${history%%[=[:IFS:]]*}:#[0-9-]*} || _guard "[0-9]#" event + fi +fi && ret=0 + +return ret diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset index 367dbfc23..4e29c23e7 100644 --- a/Completion/Zsh/Command/_typeset +++ b/Completion/Zsh/Command/_typeset @@ -46,7 +46,7 @@ use="AEFHLRTUZafghiklmprtuxz" case ${service} in autoload) - use="UXktwz" + use="UTXktwz" func=f ;; float) use="EFHghlprtux";; diff --git a/Completion/Zsh/Command/_unhash b/Completion/Zsh/Command/_unhash index c05c27ea3..ff0c03f49 100644 --- a/Completion/Zsh/Command/_unhash +++ b/Completion/Zsh/Command/_unhash @@ -1,14 +1,9 @@ #compdef unhash -local expl state line curcontext="$curcontext" - -_arguments -C -s -S \ - '(-a -f -s *)-d[remove named directories]:*:named directory:->nameddir' \ +_arguments -s -S \ + '(-a -f -s *)-d[remove named directories]:*:named directory:compadd -k nameddirs' \ '(-d -f -s *)-a[remove aliases]:*:alias:_aliases' \ '(-a -d -f *)-s[remove suffix aliases]:*:suffix alias:_aliases -s s' \ '(-d -a -s *)-f[remove functions]:*:shell function:_functions' \ '-m[treat arguments as patterns]' \ - '(-a -d -f -m)*:command: _command_names -e' && return 0 - -[[ "$state" = nameddir ]] && - _wanted named-directories expl 'named directory' compadd -k nameddirs + '(-a -d -f -m)*:command: _command_names -e' diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which index 07ede39fd..c43704ae8 100644 --- a/Completion/Zsh/Command/_which +++ b/Completion/Zsh/Command/_which @@ -6,7 +6,8 @@ cargs=( \ '(-v -c)-w[print command type]' \ '-p[always do a path search]' \ '-m[treat the arguments as patterns]' \ - '-s[print symlink free path as well]' \ + '(-S)-s[print symlink free path as well]' \ + '(-s)-S[show steps in the resolution of symlinks]' \ '*:commands:->command' ) farg='-f[output contents of functions]' aarg='-a[print all occurrences in path]' diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle index 2bfc708e5..3ed373348 100644 --- a/Completion/Zsh/Command/_zle +++ b/Completion/Zsh/Command/_zle @@ -13,20 +13,24 @@ compwids=(accept-and-menu-complete menu-expand-or-complete reverse-menu-complete) -opts=(-A -C -D -L -M -N -R -U -a -c -l \* :) +opts=(-A -C -D -F -L -M -N -R -T -U -a -c -l -r \* :) _arguments -s -S \ "($opts)-A[define widget alias]:old widget:->widget :new widget:->widget" \ "($opts)-C[define completion widget]:new widget name:->comp-widget :completion widget:->builtin-comp-widget :widget shell function:->function" \ "($opts)-D[delete widget]:*:widget:->widget" \ - \(${(j. .)opts:#-l}')-L[with -l, list as commands]' \ + \(${(j. .)opts:#-[lFT]}')-L[with -l, list as commands]' \ \(${(j. .)opts:#-[La]}')-l+[list user-defined widgets]:*:-:->listing' \ \(${(j. .)opts:#-l}')-a[with -l, list all widgets]' \ + "(: * ${(j. .)opts:#-[Lw]})-F[install file descriptor handler]:file descriptor:_file_descriptors::handler:_functions" \ + "!($opts)-K:keymap:compadd -a keymaps" \ "($opts)-M[display message]:message: " \ "($opts)-N[define new widget]:widget name:->widget-or-function ::widget shell function:->function" \ \(${(j. .)opts:#-c}')-R+[redisplay]:*:-:->redisplay' \ \(${(j. .)opts:#-R}')-c[with -R, clear listing]' \ "($opts)-U[unget to input stack]:string: " \ + '(: *)-T[manipulate transformations]:transformation:(tc):function:_functions' \ + \(${(j. .)opts:#-T}')-r[remove transformations]' \ '(-):widget:->widget' \ '(-)*::widget args:->args' && ret=0 diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index 2ebae7132..8f6c412cc 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -322,7 +322,7 @@ while (( $#state )); do (cmdorcont) _alternative -O suf \ - 'commands:command:_command ' \ + 'commands:command:_path_commands' \ 'contexts:context:(-array-value- -brace-parameter- -command- -condition- -math- -parameter- -redirect- -subscript- -value-)' ;; diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter index 2aeb12bf4..fcca4bf84 100644 --- a/Completion/Zsh/Context/_brace_parameter +++ b/Completion/Zsh/Context/_brace_parameter @@ -104,9 +104,9 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then done if [[ -z $found_percent ]]; then - flags=("%:Expand prompt sequences") + flags=("%:expand prompt sequences") else - flags=("%:Expand prompts respecting options") + flags=("%:expand prompts respecting options") fi case $q_last in (0) @@ -134,58 +134,74 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then flags+=("Q:remove one level of quoting") fi if [[ -z $found_m ]]; then - flags+=("m:Count multibyte width in padding calculation") + flags+=("m:count multibyte width in padding calculation") else - flags+=("m:Count number of character code points in padding calculation") + flags+=("m:count number of character code points in padding calculation") fi flags+=( - "#:Evaluate as numeric expression" - "@:Double-quoted splitting of scalars" - "A:Create array parameter" - "a:Sort in array index order (with O to reverse)" - "c:Count characters in an array (with \${(c)#...})" - "C:Capitalize words" - "D:Perform directory name abbreviation" - "e:Perform single-word shell expansions" - "f:Split the result on newlines" - "F:Join arrays with newlines" - "g:Process echo array sequences (needs options)" - "i:Sort case-insensitively" - "k:Subsitute keys of associative arrays" - "L:Lower case all letters" - "n:Sort decimal integers numerically" - "o:Sort in ascending order (lexically if no other sort option)" - "O:Sort in descending order (lexically if no other sort option)" - "P:Use parameter value as name of parameter for redirected lookup" - "t:Substitute type of parameter" - "u:Substitute first occurrence of each unique word" - "U:Upper case all letters" - "v:Substitute values of associative arrays (with (k))" - "V:Visibility enhancements for special characters" - "w:Count words in array or string (with \${(w)#...})" - "W:Count words including empty words (with \${(W)#...})" - "X:Report parsing errors and eXit substitution" - "z:Split words as if zsh command line" - "0:Split words on null bytes" - "p:Handle print escapes in parameter flag arguments" - "~:Treat strings in parameter flag arguments as patterns" - "j:Join arrays with specified string" - "l:Left-pad resulting words" - "r:Right-pad resulting words" - "s:Split words on specified string" - "Z:Split words as if zsh command line (with options)" - # "_:Extended flags, for future expansion" - "S:Search substrings in #, %, / expressions" - "I:Search th match in #, %, / expressions" - "B:Include index of beginning of match in #, %, / expressions" - "E:Include index of end of match in #, %, / expressions" - "M:Include matched portion in #, %, / expressions" - "N:Include length of match in #, %, expressions" - "R:Include rest (unmatched portion) in #, %, / expressions" + "#:evaluate as numeric expression" + "@:double-quoted splitting of scalars" + "A:create array parameter" + "a:sort in array index order (with O to reverse)" + "c:count characters in an array (with \${(c)#...})" + "C:capitalize words" + "D:perform directory name abbreviation" + "e:perform single-word shell expansions" + "f:split the result on newlines" + "F:join arrays with newlines" + "g:process echo array sequences (needs options)" + "i:sort case-insensitively" + "k:subsitute keys of associative arrays" + "L:lower case all letters" + "n:sort decimal integers numerically" + "o:sort in ascending order (lexically if no other sort option)" + "O:sort in descending order (lexically if no other sort option)" + "P:use parameter value as name of parameter for redirected lookup" + "t:substitute type of parameter" + "u:substitute first occurrence of each unique word" + "U:upper case all letters" + "v:substitute values of associative arrays (with (k))" + "V:visibility enhancements for special characters" + "w:count words in array or string (with \${(w)#...})" + "W:count words including empty words (with \${(W)#...})" + "X:report parsing errors and eXit substitution" + "z:split words as if zsh command line" + "0:split words on null bytes" + "p:handle print escapes or variables in parameter flag arguments" + "~:treat strings in parameter flag arguments as patterns" + "j:join arrays with specified string" + "l:left-pad resulting words" + "r:right-pad resulting words" + "s:split words on specified string" + "Z:split words as if zsh command line (with options)" + # "_:extended flags, for future expansion" + "S:search substrings in #, %, / expressions" + "I:search th match in #, %, / expressions" + "B:include index of beginning of match in #, %, / expressions" + "E:include index of end of match in #, %, / expressions" + "M:include matched portion in #, %, / expressions" + "N:include length of match in #, % expressions" + "R:include rest (unmatched portion) in #, %, / expressions" ) _describe -t flags "parameter flag" flags -Q -S '' return +elif compset -P '*:([\|\*\^]|\^\^)'; then + _arrays + return elif compset -P '*:'; then + flags=( + '-:substitute alternate value if parameter is null' + '+:susbtitute alternate value if parameter is non-null' + '=:substitute and assign alternate value if parameter is null' + '\:=:unconditionally assign value to parameter' + '?:print error if parameter is set and non-null' + '#:filter value matching pattern' + '|:set difference' + '*:set intersection' + '^:zip arrays' + '^^:zip arrays reusing values from shorter array' + ) + _describe -t flags "operator" flags -Q -S '' _history_modifiers p return fi diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript index cf1ec49a4..0ccc0c4ef 100644 --- a/Completion/Zsh/Context/_subscript +++ b/Completion/Zsh/Context/_subscript @@ -23,7 +23,7 @@ if [[ $BUFFER[1,pos-1] = (|*[[:space:]:=]##)\~\[ ]]; then elif [[ "$PREFIX" = :* ]]; then _wanted characters expl 'character class' \ compadd -p: -S ':]' alnum alpha ascii blank cntrl digit graph \ - lower print punct space upper xdigit + lower print punct space upper xdigit IFS IDENT IFSSPACE WORD elif compset -P '\('; then local match compset -S '\)*' diff --git a/Completion/Zsh/Type/_globflags b/Completion/Zsh/Type/_globflags index ca665466b..5833dc8f1 100644 --- a/Completion/Zsh/Type/_globflags +++ b/Completion/Zsh/Type/_globflags @@ -4,11 +4,17 @@ local ret=1 local -a flags if compset -P a; then - _message -e numbers 'errors' + _message -e number 'errors' return elif compset -P q; then _globquals return +elif compset -P 'c[0-9]##,'; then + _message -e number 'max repetitions' + return +elif compset -P c; then + _message -e number 'repetitions (min or exact)' + return fi flags=( @@ -17,6 +23,8 @@ flags=( 'I:case sensitive matching' 's:match start of string' 'e:match end of string' + 'U:consider all characters to be one byte' + 'u:support multibyte characters in pattern' ) [[ $compstate[context] = condition ]] && flags+=( 'b:activate backreferences' @@ -29,6 +37,7 @@ _describe -t globflags "glob flag" flags -Q -S ')' && ret=0 flags=( 'a:approximate matching' 'q:introduce glob qualifier' + 'c:match repetitions of preceding pattern' ) _describe -t globflags "glob flag" flags -Q -S '' && ret=0 diff --git a/Completion/Zsh/Type/_history_modifiers b/Completion/Zsh/Type/_history_modifiers index f8dcd45ae..658f9f346 100644 --- a/Completion/Zsh/Type/_history_modifiers +++ b/Completion/Zsh/Type/_history_modifiers @@ -66,6 +66,7 @@ while true; do list+=( "a:absolute path" "A:absolute path resolving symbolic links" + "c:PATH search for command" "g:globally apply s or &" "h:head - strip trailing path element" "t:tail - strip directories" diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index dc3937108..f3bcc3564 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -142,7 +142,7 @@ ifnzman(noderef(Aliasing)). findex(autoload) cindex(functions, autoloading) cindex(autoloading functions) -item(tt(autoload) [ {tt(PLUS())|tt(-)}tt(UXkmtz) ] [ tt(-w) ] [ var(name) ... ])( +item(tt(autoload) [ {tt(PLUS())|tt(-)}tt(TUXkmtz) ] [ tt(-w) ] [ var(name) ... ])( Equivalent to tt(functions -u), with the exception of tt(-X)/tt(+X) and tt(-w). -- cgit v1.2.3 From 1c942291f8a41d80d7db4e7513adf06edfe50277 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 30 Jan 2015 16:24:20 +0000 Subject: 34435: Update emulate completion. Add new feature to run command in emulation. Factor out handling of quoted command string to new function. --- ChangeLog | 7 +++++++ Completion/Unix/Command/_sh | 3 +-- Completion/Unix/Type/_cmdstring | 6 ++++++ Completion/Zsh/Command/_emulate | 6 ++++-- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 Completion/Unix/Type/_cmdstring (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index ee6860c0c..269fa3932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-01-30 Peter Stephenson + + * 34435: Completion/Unix/Command/_sh, + Completion/Unix/Type/_cmdstring, Completion/Zsh/Command/_emulate: + updated emulate completion; _cmdstring factors out use of + quoted command string. + 2015-01-29 Peter Stephenson * 34430: Src/Modules/db_gdbm.c, Src/params.c: various bug fixes diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh index 104c7576c..21ebfc3b2 100644 --- a/Completion/Unix/Command/_sh +++ b/Completion/Unix/Command/_sh @@ -10,8 +10,7 @@ if [[ $service == zsh ]]; then fi if (( CURRENT == ${words[(i)-c]} + 1 )); then - compset -q - _normal + _cmdstring else local n=${words[(b:2:i)[^-]*]} if (( n <= CURRENT )); then diff --git a/Completion/Unix/Type/_cmdstring b/Completion/Unix/Type/_cmdstring new file mode 100644 index 000000000..fb19fdb76 --- /dev/null +++ b/Completion/Unix/Type/_cmdstring @@ -0,0 +1,6 @@ +#autoload + +# This is for a quoted argument that will be interpreted as a command. + +compset -q +_normal diff --git a/Completion/Zsh/Command/_emulate b/Completion/Zsh/Command/_emulate index e562d6834..d6fb0c3d9 100644 --- a/Completion/Zsh/Command/_emulate +++ b/Completion/Zsh/Command/_emulate @@ -1,6 +1,8 @@ #compdef emulate -_arguments -C -s -A "-*" \ +_arguments -C -s \ '-L[set local_options and local_traps as well]' \ '-R[reset all options instead of only those needed for script portability]' \ - '::shell to emulate:(zsh sh ksh csh)' + '1:shell to emulate:(zsh sh ksh csh)' \ + '2:specify optional command:(-c)' \ + '3:command:_cmdstring' -- cgit v1.2.3 From 19010fafd9600fda83f7dae0bbc7fbc945204bf0 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 4 Mar 2015 22:32:12 +0000 Subject: New completion for add-zsh-hook --- ChangeLog | 5 +++++ Completion/Zsh/Function/_add-zsh-hook | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Completion/Zsh/Function/_add-zsh-hook (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 0816dc501..6e49415ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-05 Peter Stephenson + + * Daniel Shahaf: 34647: Completion/Zsh/Function/_add-zsh-hook: + new completion. + 2015-03-05 Jun-ichi Takimoto * 34636: Src/compat.c, Src/pattern.c, Src/utils.c, Src/ztype.c, diff --git a/Completion/Zsh/Function/_add-zsh-hook b/Completion/Zsh/Function/_add-zsh-hook new file mode 100644 index 000000000..c70a4976f --- /dev/null +++ b/Completion/Zsh/Function/_add-zsh-hook @@ -0,0 +1,24 @@ +#compdef add-zsh-hook + +local context state state_descr line +typeset -A opt_args + +_add-zsh-hook_hooks() { + if (( $+opt_args[-d] )); then + _wanted functions expl "installed hooks" compadd -a - "$line[1]_functions" && return 0 + else + _functions && return 0 + fi + return 1 +} + +_add-zsh-hook() { + _arguments -s -w -S : \ + '(-D)-d[remove HOOK from the array]' \ + '(-d)-D[interpret HOOK as pattern to remove from the array]' \ + {-U,-z,-k}"[passed to 'autoload']" \ + ':hook class:(chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name)' \ + ':hook function:_add-zsh-hook_hooks' +} + +_add-zsh-hook "$@" -- cgit v1.2.3 From 205cb16b98793c0db797b6f1a76492854a4afb55 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 14 Mar 2015 04:37:55 +0100 Subject: Fix ~ and (Q) order in _zattr --- ChangeLog | 5 +++++ Completion/Zsh/Command/_zattr | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 9f523eb76..abc0a6aa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-15 Mikael Magnusson + + * unposted: Completion/Zsh/Command/_zattr: Fix completion of + attributes for files with pattern characters. + 2015-03-10 Peter Stephenson * users/19985: Doc/Zsh/params.yo: improve doc of substring diff --git a/Completion/Zsh/Command/_zattr b/Completion/Zsh/Command/_zattr index 73564172b..e48047f6c 100644 --- a/Completion/Zsh/Command/_zattr +++ b/Completion/Zsh/Command/_zattr @@ -28,7 +28,7 @@ _arguments \ esac && ret=0 if [[ $state = attrs ]]; then - zlistattr ${~${(Q)line[1]}} REPLY 2> /dev/null + zlistattr ${(Q)${~line[1]}} REPLY 2> /dev/null _wanted -C "$context[1]" attrs expl 'attribute' compadd -a REPLY && ret=0 fi -- cgit v1.2.3 From 741b0bd97f6ddbd69fb2fa1dbbf6604a51488d82 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 13 Apr 2015 21:03:24 +0000 Subject: users/20159: completion: zstyle: Add 'show-ambiguity' --- ChangeLog | 3 +++ Completion/Zsh/Command/_zstyle | 1 + 2 files changed, 4 insertions(+) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index fc7b92d99..da61364d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-04-13 Daniel Shahaf + * users/20159: Completion/Zsh/Command/_zstyle: completion: zstyle: + Add 'show-ambiguity' + * 34886: Completion/Unix/Command/_git: completion: git: Complete rebase --exec argument diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index 8f6c412cc..9a6d61891 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -125,6 +125,7 @@ styles=( select-prompt c: select-scroll c: separate-sections c:bool + show-ambiguity c: show-completer c:bool single-ignored c:single-ignored sort c:bool -- cgit v1.2.3 From dd623b44032b11509ccc2e6f8c307d2f7bd2d722 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 18 Apr 2015 17:44:54 +0200 Subject: 34926: _fc: Remove a spurious 2 --- ChangeLog | 4 ++++ Completion/Zsh/Command/_fc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 6555883e8..f871f54a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-04-19 Mikael Magnusson + + * 34926: Completion/Zsh/Command/_fc: Remove a spurious 2 + 2015-04-17 Peter Stephenson * 34921: Src/parse.c: handle error in recursive par_event(). diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc index 133145670..ccdc3faa1 100644 --- a/Completion/Zsh/Command/_fc +++ b/Completion/Zsh/Command/_fc @@ -32,7 +32,7 @@ else fi fc_hist=( - '(-A -R -W -I -a -p -P 2)-m[treat argument as a pattern]' + '(-A -R -W -I -a -p -P)-m[treat argument as a pattern]' '(-A -R -W -I -e -f -E -i -t -a -p -P)-d[print time-stamps]' '(-A -R -W -I -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]' '(-A -R -W -I -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]' -- cgit v1.2.3 From 9a0f5ea8a7bc7a1a467664632f17237d1c60d22c Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 21 Apr 2015 12:16:13 +0200 Subject: Revert "34926: _fc: Remove a spurious 2" This reverts commit dd623b44032b11509ccc2e6f8c307d2f7bd2d722. --- ChangeLog | 4 ---- Completion/Zsh/Command/_fc | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index f871f54a3..6555883e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,3 @@ -2015-04-19 Mikael Magnusson - - * 34926: Completion/Zsh/Command/_fc: Remove a spurious 2 - 2015-04-17 Peter Stephenson * 34921: Src/parse.c: handle error in recursive par_event(). diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc index ccdc3faa1..133145670 100644 --- a/Completion/Zsh/Command/_fc +++ b/Completion/Zsh/Command/_fc @@ -32,7 +32,7 @@ else fi fc_hist=( - '(-A -R -W -I -a -p -P)-m[treat argument as a pattern]' + '(-A -R -W -I -a -p -P 2)-m[treat argument as a pattern]' '(-A -R -W -I -e -f -E -i -t -a -p -P)-d[print time-stamps]' '(-A -R -W -I -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]' '(-A -R -W -I -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]' -- cgit v1.2.3 From f4d8051de1179a47632b56afdf8659dac689e51f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 24 Apr 2015 10:54:14 +0200 Subject: 34940: _fc: fix typo breaking completion for history --- ChangeLog | 5 +++++ Completion/Zsh/Command/_fc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 6555883e8..094a35b08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-04-24 Mikael Magnusson + + * Oliver: 34940: Completion/Zsh/Command/_fc: fix typo breaking + completion for history + 2015-04-17 Peter Stephenson * 34921: Src/parse.c: handle error in recursive par_event(). diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc index 133145670..c2987211e 100644 --- a/Completion/Zsh/Command/_fc +++ b/Completion/Zsh/Command/_fc @@ -49,7 +49,7 @@ fc_r='(-A -R -W -I -e)-l[list resulting commands on stdout]' case $service in history) - _arguments "$fc_common[@]" "$fc_hist[@] && ret=0" + _arguments "$fc_common[@]" "$fc_hist[@]" && ret=0 ;; r) _arguments "$fc_common[@]" "$fc_r" && ret=0 -- cgit v1.2.3 From cfc2a17c4e0e9128682bcbb96a4a2eafe0a4b425 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 May 2015 12:01:06 +0100 Subject: 35033: trivial zcalc completion --- ChangeLog | 4 ++++ Completion/Zsh/Function/_zcalc | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 Completion/Zsh/Function/_zcalc (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index 0bc8b61b1..d7a2c0553 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-05-05 Peter Stephenson + + * 35033: Completion/Zsh/Function/_zcalc: trivial completion. + 2015-05-04 Oliver Kiddle * 35029: Src/Zle/zle_word.c, Test/X02zlevi.ztst: diff --git a/Completion/Zsh/Function/_zcalc b/Completion/Zsh/Function/_zcalc new file mode 100644 index 000000000..a4b1e9701 --- /dev/null +++ b/Completion/Zsh/Function/_zcalc @@ -0,0 +1,7 @@ +#compdef zcalc + +_arguments -s -w -S : \ + '-#[Specify default base]:base: ' \ + '-f[Force floating point for all expressions]' \ + '-e[Treat command line as expressions to be output immediately]' \ + '*:Expression: ' -- cgit v1.2.3 From fa769f27d628bb03d0c6f9b3e3fc7c83c7fa8bb5 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 May 2015 14:47:11 +0100 Subject: unposted: fix descriptions in previous -zcalc commit (cosmetic) --- ChangeLog | 2 ++ Completion/Zsh/Function/_zcalc | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Completion/Zsh') diff --git a/ChangeLog b/ChangeLog index d7a2c0553..8afa7a877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-05-05 Peter Stephenson + * unposted: fix descriptions in previous commit (cosmetic). + * 35033: Completion/Zsh/Function/_zcalc: trivial completion. 2015-05-04 Oliver Kiddle diff --git a/Completion/Zsh/Function/_zcalc b/Completion/Zsh/Function/_zcalc index a4b1e9701..093a7a91d 100644 --- a/Completion/Zsh/Function/_zcalc +++ b/Completion/Zsh/Function/_zcalc @@ -1,7 +1,7 @@ #compdef zcalc _arguments -s -w -S : \ - '-#[Specify default base]:base: ' \ - '-f[Force floating point for all expressions]' \ - '-e[Treat command line as expressions to be output immediately]' \ - '*:Expression: ' + '-#[specify default base]:base: ' \ + '-f[force floating point for all expressions]' \ + '-e[treat command line as expressions to be output immediately]' \ + '*:expression: ' -- cgit v1.2.3