mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-10 10:21:23 +02:00
31756: further make completion improvements.
ake care of mutually exclusive options. Add _description using $state_descr. Add completions for --debug=flag. Fix typo (pointed out by Daniel Shahaf).
This commit is contained in:
parent
4095e175b6
commit
c5d9abc6c8
2 changed files with 49 additions and 32 deletions
|
@ -1,5 +1,10 @@
|
||||||
2013-07-25 Peter Stephenson <p.stephenson@samsung.com>
|
2013-07-25 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* Jun T.: 31756: Completion/Unix/Command/_make: further make
|
||||||
|
completion improvements: tke care of mutually exclusive options;
|
||||||
|
add _description using $state_descr; add completions for
|
||||||
|
--debug=flag; fix typo (pointed out by Daniel Shahaf).
|
||||||
|
|
||||||
* 31574: Src/parse.c: alternative fix to 31545 if FD_CLOEXEC is
|
* 31574: Src/parse.c: alternative fix to 31545 if FD_CLOEXEC is
|
||||||
not available, removing dump records more consistently.
|
not available, removing dump records more consistently.
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ _make-findBasedir () {
|
||||||
_make() {
|
_make() {
|
||||||
|
|
||||||
local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match
|
local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match
|
||||||
local context state line
|
local context state state_descr line
|
||||||
local -a option_specs
|
local -a option_specs
|
||||||
local -A TARGETS VARIABLES opt_args
|
local -A TARGETS VARIABLES opt_args
|
||||||
local ret=1
|
local ret=1
|
||||||
|
@ -159,35 +159,35 @@ _make() {
|
||||||
then
|
then
|
||||||
incl="(-|)include"
|
incl="(-|)include"
|
||||||
option_specs=(
|
option_specs=(
|
||||||
{-B,--always-make}'[Unconditionally make all targets]'
|
'(-B --always-make)'{-B,--always-make}'[unconditionally make all targets]'
|
||||||
'*'{-C,--directory=}'[change directory first]:directory:->dir'
|
'*'{-C,--directory=}'[change directory first]:change to directory:->dir'
|
||||||
'-d[Print lots of debug information]'
|
'-d[print lots of debug information]'
|
||||||
'--debug=-[Print various types of debug information]:FLAGS'
|
'--debug=-[print various types of debug information]:debug options:->debug'
|
||||||
{-e,--environment-overrides}'[Environment variables override makefiles]'
|
'(-e --environment-overrides)'{-e,--environment-overrides}'[environment variables override makefiles]'
|
||||||
'--eval=-[Evaluate STRING as a makefile statement]:STRING'
|
'--eval=-[evaluate STRING as a makefile statement]:STRING'
|
||||||
{-f,--file=,--makefile=}'[Read FILE as a makefile]:file:->file'
|
'(-f --file --makefile)'{-f,--file=,--makefile=}'[read FILE as a makefile]:makefile:->file'
|
||||||
'-h[Print this message and exit]'
|
'(- *)'{-h,--help}'[print help message and exit]'
|
||||||
{-i,--ignore-errors}'[Ignore errors from recipes]'
|
'(-i --ignore-errors)'{-i,--ignore-errors}'[ignore errors from recipes]'
|
||||||
'*'{-I,--include-dir=}'[Search DIRECTORY for included makefiles]:directory:->dir'
|
'*'{-I,--include-dir=}'[search DIRECTORY for included makefiles]:search path for included makefile:->dir'
|
||||||
{-j,--jobs=}'[Allow N jobs at once; infinite jobs with no arg]:number of jobs'
|
'(-j --jobs)'{-j,--jobs=}'[allow N jobs at once; infinite jobs with no arg]:number of jobs'
|
||||||
{-k,--keep-going}"[Keep going when some targets can't be made]"
|
'(-k --keep-going)'{-k,--keep-going}"[keep going when some targets can't be made]"
|
||||||
{-l,--load-average=,--max-load}"[Don't start multiple jobs unless load is below N]:load"
|
'(-l --load-average --max-load)'{-l,--load-average=,--max-load}"[don't start multiple jobs unless load is below N]:load"
|
||||||
{-L,--check-symlink-times}'[Use the latest mtime between symlinks and target]'
|
'(-L --check-symlik-times)'{-L,--check-symlink-times}'[use the latest mtime between symlinks and target]'
|
||||||
{-n,--just-print,--dry-run,--recon}"[Don't actually run any recipe; just print them]"
|
'(-n --just-print --dry-run --recon)'{-n,--just-print,--dry-run,--recon}"[don't actually run any recipe; just print them]"
|
||||||
'*'{-o,--old-file=,--assume-old=}"[Consider FILE to be very old and don't remake it]:file not to remake:->file"
|
'*'{-o,--old-file=,--assume-old=}"[consider FILE to be very old and don't remake it]:file not to remake:->file"
|
||||||
{-p,--print-data-base}'[Print makes internal database]'
|
'(-p --print-data-base)'{-p,--print-data-base}'[print makes internal database]'
|
||||||
{-q,--question}'[Run no recipe; exit status says if up to date]'
|
'(-q --question)'{-q,--question}'[run no recipe; exit status says if up to date]'
|
||||||
{-r,--no-builtin-rules}'[Disable the built-in implicit rules]'
|
'(-r --no-builtin-rules)'{-r,--no-builtin-rules}'[disable the built-in implicit rules]'
|
||||||
{-R,--no-builtin-variables}'[Disable the built-in variable settings]'
|
'(-R --no-builtin-variables)'{-R,--no-builtin-variables}'[disable the built-in variable settings]'
|
||||||
{-s,--silent,--quiet}"[Don't echo recipes]"
|
'(-s --silent --quiet)'{-s,--silent,--quiet}"[don't echo recipes]"
|
||||||
{-S,--no-keep-going,--stop}'[Turns off -k]'
|
'(-S --no-keep-going --stop)'{-S,--no-keep-going,--stop}'[turns off -k]'
|
||||||
{-t,--touch}'[Touch targets instead of remaking them]'
|
'(-t --touch)'{-t,--touch}'[touch targets instead of remaking them]'
|
||||||
{-v,--version}'[Print the version number of make and exit]'
|
'(- *)'{-v,--version}'[print the version number of make and exit]'
|
||||||
{-w,--print-directory}'[Print the current directory]'
|
'(-w --print-directory)'{-w,--print-directory}'[print the current directory]'
|
||||||
'--no-print-directory[Turn off -w, even if it was turned on implicitly]'
|
'--no-print-directory[turn off -w, even if it was turned on implicitly]'
|
||||||
'*'{-W,--what-if=,--new-file=,--asume-new=}'[Consider FILE to be infinitely new]:file to treat as modified:->file'
|
'*'{-W,--what-if=,--new-file=,--assume-new=}'[consider FILE to be infinitely new]:file to treat as modified:->file'
|
||||||
'--warn-undefined-variables[Warn when an undefined variable is referenced]'
|
'--warn-undefined-variables[warn when an undefined variable is referenced]'
|
||||||
'--warn-undefined-functions[Warn when an undefined user function is called]'
|
'--warn-undefined-functions[warn when an undefined user function is called]'
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
# Basic make options only.
|
# Basic make options only.
|
||||||
|
@ -206,11 +206,23 @@ _make() {
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
(dir)
|
(dir)
|
||||||
_files -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0
|
_description directories expl "$state_descr"
|
||||||
|
_files "$expl[@]" -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(file)
|
(file)
|
||||||
_files -W ${(q)$(_make-findBasedir $words)} && ret=0
|
_description files expl "$state_descr"
|
||||||
|
_files "$expl[@]" -W ${(q)$(_make-findBasedir $words)} && ret=0
|
||||||
|
;;
|
||||||
|
|
||||||
|
(debug)
|
||||||
|
_values -s , 'debug options' \
|
||||||
|
'(b v i j m)a[all debugging output]' \
|
||||||
|
'b[basic debugging output]' \
|
||||||
|
'(b)v[one level above basic]' \
|
||||||
|
'(b)i[describe implicit rule searches (implies b)]' \
|
||||||
|
'j[show details on invocation of subcommands]' \
|
||||||
|
'm[enable debugging while remaking makefiles]' && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(target)
|
(target)
|
||||||
|
|
Loading…
Reference in a new issue