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

This commit is contained in:
Julien Nicoulaud 2011-08-21 13:32:39 +02:00
parent f5c8471e6f
commit c1c79d4549
1 changed files with 25 additions and 8 deletions

View File

@ -91,7 +91,7 @@ _android() {
esac
;;
(create)
_arguments \
_arguments -C \
'1: :_android_create_entities' \
'*::create-arg:->create-args' \
&& ret=0
@ -138,8 +138,9 @@ _android() {
esac
;;
(update)
_arguments \
_arguments -C \
'1: :_android_update_entities' \
'*::update-arg:->update-args' \
&& ret=0
# TODO Options:
# Action "update avd":
@ -175,8 +176,9 @@ _android() {
# -n --dry-mode Simulates the update but does not download or install anything
;;
(move)
_arguments \
_arguments -C \
'1: :_android_move_entities' \
'*::move-arg:->move-args' \
&& ret=0
# TODO Options:
# Action "move avd":
@ -185,12 +187,21 @@ _android() {
# -r --rename New name of the AVD
;;
(delete)
_arguments \
_arguments -C \
'1: :_android_delete_entities' \
'*::delete-arg:->delete-args' \
&& ret=0
# TODO Options:
# Action "delete avd":
# -n --name Name of the AVD to delete [required]
case "$state" in
(delete-args)
case $words[1] in
(avd)
_arguments \
'(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \
&& ret=0
;;
esac
;;
esac
;;
(display)
_arguments \
@ -282,4 +293,10 @@ _android_targets() {
_describe -t targets 'target' targets "$@"
}
(( $+functions[_android_avd_names] )) ||
_android_avd_names() {
local avd_names; avd_names=(${(f)"$(_call_program targets $android_cmd list avd --compact)"//:/\\:})
_describe -t avd-names 'AVD name' avd_names "$@"
}
_android "$@"