mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 21:51:40 +02:00
21540: update aap completion for version 1.076
This commit is contained in:
parent
4714ce0856
commit
b45500cdd8
2 changed files with 25 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-07-28 Doug Kearns <djkea2@gus.gscit.monash.edu.au>
|
||||
|
||||
* 21540: Completion/Unix/Command/_aap: update aap completion for version
|
||||
1.076; add target descriptions; search up directory tree for main.aap
|
||||
recipe file if --up is specified
|
||||
|
||||
2005-07-26 Wayne Davison <wayned@users.sourceforge.net>
|
||||
|
||||
* unposted: Src/utils.c, Src/Zle/zle_main.c, Doc/Zsh/options.yo:
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#compdef aap
|
||||
|
||||
# A-A-P recipe executive version 1.001; released 2003 Jul 05 20:44:44 GMT
|
||||
# A-A-P recipe executive version 1.076; released 2005 May 30 12:47:03 GMT
|
||||
|
||||
local curcontext="$curcontext" state line ret=1
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
_arguments -C -s -S \
|
||||
'(- *)'{-V,--version}'[print version information and exit]' \
|
||||
'(- *)'{-h,--help}'[print help information and exit]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[print more information]' \
|
||||
'(-s --silent)'{-s,--silent}'[print less information]' \
|
||||
'(-s --silent -v --verbose)'{-v,--verbose}'[print more information]' \
|
||||
'(-v --verbose -s --silent)'{-s,--silent}'[print less information]' \
|
||||
'(-d --debug)'{-d,--debug=}'[debug the specified items]:flags:' \
|
||||
'--profile=[profile A-A-P execution and write results in specified file]:output file:_files' \
|
||||
'(-n --nobuild)'{-n,--nobuild}'[print the build commands but do not execute them]' \
|
||||
|
@ -20,25 +20,30 @@ _arguments \
|
|||
\*{-c,--command=}'[execute a command after reading the recipe]:aap command:' \
|
||||
'(-k --continue)'{-k,--continue}'[continue building after an error]' \
|
||||
'(-S --stop)'{-S,--stop}'[stop building at first error (default)]' \
|
||||
'(-R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \
|
||||
'(-N --nofetch-recipe)'{-N,--nofetch-recipe}'[do not fetch recipes for "fetch" target]' \
|
||||
'(-N,--nofetch-recipe -R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \
|
||||
'(-R --fetch-recipe -N --nofetch-recipe)'{-N,--nofetch-recipe}'[do not fetch recipes for "fetch" target]' \
|
||||
'(-a --nocache)'{-a,--nocache}"[always download files, don't use the cache]" \
|
||||
'(-l --local)'{-l,--local}'[do not recurse into subdirectories]' \
|
||||
'(-j --jobs)'{-j,--jobs=}'[maximum number of parallel jobs]:number of jobs:' \
|
||||
'(-u --search-up --up)'{-u,--search-up,--up}'[search directory tree upwards for main.aap recipe]' \
|
||||
'(-f --recipe -u --search-up --up)'{-u,--search-up,--up}'[search directory tree upwards for main.aap recipe]' \
|
||||
\*{-I,--include=}'[directory to search for included recipes]:include directory:_files -/' \
|
||||
'(-f --recipe)'{-f,--recipe=}'[recipe file to be executed]:recipe file:_files -g \*.aap\(-.\)' \
|
||||
'(-u --search-up --up -f --recipe)'{-f,--recipe=}'[recipe file to be executed]:recipe file:_files -g \*.aap\(-.\)' \
|
||||
'--install=[install specified package]:package name:' \
|
||||
'--[end of options, targets and assignments follow]' \
|
||||
'*:aap target:->target' && ret=0
|
||||
|
||||
if [[ "$state" = target ]]; then
|
||||
local aap_targets aap_recipe expl
|
||||
|
||||
aap_recipe=${(v)opt_args[(I)(-f|--recipe)]:-main.aap}
|
||||
if [[ -f $aap_recipe ]] && _tags targets; then
|
||||
aap_targets=( "${(@)${(@)${(@f)$( _call_program targets "$words[1]" -f $aap_recipe comment 2>/dev/null )}#target }%%: *}" comment )
|
||||
_wanted targets expl target compadd -a aap_targets && ret=0
|
||||
local targets recipe
|
||||
if [[ -n $opt_args[(I)(-u|--search-up|--up)] ]]; then
|
||||
recipe=( (../)#main.aap(N[-1]) )
|
||||
else
|
||||
recipe=${(v)opt_args[(I)(-f|--recipe)]:-main.aap}
|
||||
fi
|
||||
if [[ -f $recipe ]]; then
|
||||
targets=( ${${(f)"$(_call_program targets $words[1] -f $recipe comment 2>/dev/null)"}/(#b)target (*):[[:blank:]]##(*)/$match[1]:${match[2]:l}} comment )
|
||||
_describe -t targets 'aap target' targets && ret=0
|
||||
else
|
||||
_message -e targets 'aap target'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue