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

This commit is contained in:
Julien Nicoulaud 2011-08-21 13:26:46 +02:00
parent f97c5703c5
commit f5c8471e6f
1 changed files with 48 additions and 27 deletions

View File

@ -93,34 +93,49 @@ _android() {
(create) (create)
_arguments \ _arguments \
'1: :_android_create_entities' \ '1: :_android_create_entities' \
'*::create-arg:->create-args' \
&& ret=0 && ret=0
# TODO Options: case "$state" in
# Action "create avd": (create-args)
# -c --sdcard Path to a shared SD card image, or size of a new sdcard for the new AVD case $words[1] in
# -n --name Name of the new AVD [required] (avd)
# -a --snapshot Place a snapshots file in the AVD, to enable persistence. _arguments \
# -p --path Directory where the new AVD will be created '(-c --sdcard)'{-c,--sdcard}'[path to a shared SD card image, or size of a new sdcard for the new AVD]:SD card image or size:_files -g "*.img"' \
# -f --force Forces creation (overwrites an existing AVD) '(-n --name)'{-n,--name}'[name of the new AVD]:name' \
# -s --skin Skin for the new AVD '(-a --snapshot)'{-a,--snapshot}'[place a snapshots file in the AVD, to enable persistence]' \
# -t --target Target ID of the new AVD [required] '(-p --path)'{-p,--path}'[directory where the new AVD will be created]: :_files -/' \
# '(-f --force)'{-f,--force}'[forces creation (overwrites an existing AVD)]' \
# Action "create project": '(-s --skin)'{-s,--skin}'[skin for the new AVD]:skin' \
# -n --name Project name '(-t --target)'{-t,--target}'[target ID of the new AVD]: :_android_targets' \
# -t --target Target ID of the new project [required] && ret=0
# -p --path The new project's directory [required] ;;
# -k --package Android package name for the application [required] (project)
# -a --activity Name of the default Activity that is created [required] _arguments \
# '(-n --name)'{-n,--name}'[project name]:project name' \
# Action "create test-project": '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
# -p --path The new project's directory [required] '(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
# -n --name Project name '(-a --activity)'{-a,--activity}'[name of the default Activity that is created]:activity name' \
# -m --main Path to directory of the app under test, relative to the test project directory [required] '(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
# && ret=0
# Action "create lib-project": ;;
# -n --name Project name (test-project)
# -t --target Target ID of the new project [required] _arguments \
# -k --package Android package name for the library [required] '(-n --name)'{-n,--name}'[project name]:project name' \
# -p --path The new project's directory [required] '(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
'(-m --main)'{-m,--main}'[path to directory of the app under test, relative to the test project directory]:path' \
&& ret=0
;;
(lib-project)
_arguments \
'(-n --name)'{-n,--name}'[project name]:project name' \
'(-p --path)'{-p,--path}'[the new project'\''s directory]: :_files -/' \
'(-k --package)'{-k,--package}'[Android package name for the application]:package name' \
'(-t --target)'{-t,--target}'[target ID of the new project]: :_android_targets' \
&& ret=0
;;
esac
;;
esac
;; ;;
(update) (update)
_arguments \ _arguments \
@ -261,4 +276,10 @@ _android_display_entities() {
_describe -t entities 'entity' entities "$@" _describe -t entities 'entity' entities "$@"
} }
(( $+functions[_android_targets] )) ||
_android_targets() {
local targets; targets=(${(f)"$(_call_program targets $android_cmd list target --compact)"//:/\\:})
_describe -t targets 'target' targets "$@"
}
_android "$@" _android "$@"