#42 android: Complete options for the 'update' command

This commit is contained in:
Julien Nicoulaud 2011-08-21 13:53:01 +02:00
parent bb121cb11b
commit 0f5805d399
1 changed files with 50 additions and 32 deletions

View File

@ -142,38 +142,50 @@ _android() {
'1: :_android_update_entities' \ '1: :_android_update_entities' \
'*::update-arg:->update-args' \ '*::update-arg:->update-args' \
&& ret=0 && ret=0
# TODO Options: case "$state" in
# Action "update avd": (update-args)
# -n --name Name of the AVD to update [required] case $words[1] in
# (avd)
# Action "update project": _arguments \
# -l --library Directory of an Android library to add, relative to this project's directory '(-n --name)'{-n,--name}'[name of the AVD to update]: :_android_avd_names' \
# -p --path The project's directory [required] && ret=0
# -n --name Project name ;;
# -t --target Target ID to set for the project (project)
# -s --subprojects Also updates any projects in sub-folders, such as test projects. _arguments \
# '(-l --library)'{-l,--library}'[directory of an Android library to add, relative to this project'\''s directory]: :_files -/' \
# Action "update test-project": '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
# -m --main Directory of the app under test, relative to the test project directory [required] '(-n --name)'{-n,--name}'[project name]:name' \
# -p --path The project's directory [required] '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
# '(-s --subprojects)'{-s,--subprojects}'[also updates any projects in sub-folders, such as test projects]' \
# Action "update lib-project": && ret=0
# -p --path The project's directory [required] ;;
# -t --target Target ID to set for the project (test-project)
# _arguments \
# Action "update adb": '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
# No options '(-m --main)'{-m,--main}'[directory of the app under test, relative to the test project directory]:path' \
# && ret=0
# Action "update sdk": ;;
# --proxy-port HTTP/HTTPS proxy port (overrides settings if defined) (lib-project)
# --proxy-host HTTP/HTTPS proxy host (overrides settings if defined) _arguments \
# -s --no-https Uses HTTP instead of HTTPS (the default) for downloads '(-p --path)'{-p,--path}'[the project'\''s directory]: :_files -/' \
# -f --force Forces replacement of a package or its parts, even if something has been modified '(-t --target)'{-t,--target}'[target ID to set for the project]: :_android_targets' \
# -u --no-ui Updates from command-line (does not display the GUI) && ret=0
# -o --obsolete Installs obsolete packages ;;
# -t --filter A filter that limits the update to the specified types of packages in the form of (sdk)
# a comma-separated list of [platform, tool, platform-tool, doc, sample, extra] _arguments \
# -n --dry-mode Simulates the update but does not download or install anything '(-o --obsolete)'{-o,--obsolete}'[install obsolete packages]' \
'--proxy-host[HTTP/HTTPS proxy host (overrides settings if defined)]:proxy host:_hosts' \
'--proxy-port[HTTP/HTTPS proxy port (overrides settings if defined)]:proxy port number' \
'(-s --no-https)'{-s,--no-https}'[use HTTP instead of HTTPS (the default) for downloads]' \
'(-u --no-ui)'{-u,--no-ui}'[update from command-line (no GUI)]' \
'(-f --force)'{-f,--force}'[force replacement of a package or its parts, even if something has been modified]' \
'(-t --filter)'{-t,--filter}'[a filter that limits the update to the specified types of packages]: :_android_sdk_update_filters -s ,' \
'(-n --dry-mode)'{-n,--dry-mode}'[simulate the update but does not download or install anything]' \
&& ret=0
;;
esac
;;
esac
;; ;;
(move) (move)
_arguments -C \ _arguments -C \
@ -307,4 +319,10 @@ _android_avd_names() {
_describe -t avd-names 'AVD name' avd_names "$@" _describe -t avd-names 'AVD name' avd_names "$@"
} }
(( $+functions[_android_sdk_update_filters] )) ||
_android_sdk_update_filters() {
local filters; filters=(platform tool platform-tool doc sample extra)
_values $@ 'filter' "${filters[@]}"
}
_android "$@" _android "$@"