Skip to content

Commit

Permalink
zsh-users#42 android: Add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoulaj committed Aug 21, 2011
1 parent 6b01b5f commit f15297f
Showing 1 changed file with 121 additions and 1 deletion.
122 changes: 121 additions & 1 deletion _android
Expand Up @@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for android command
# Completion script for the android command (Revision 12)
# (http://developer.android.com/guide/developing/tools/android.html).
#
# ------------------------------------------------------------------------------
Expand All @@ -51,6 +51,8 @@ _android() {

android_cmd="$words[1]"

# FIXME Global options must be before the command
# TODO -h takes an optional command name
_arguments -C \
'(- : *)'{-h,--help}'[get help on a specific command]' \
'(-s --silent)'{-v,--verbose}'[verbose mode: errors, warnings and informational messages are printed]' \
Expand All @@ -67,26 +69,143 @@ _android() {
_arguments \
'1: :_android_list_entities' \
&& ret=0
# TODO Options:
# Action "list ":
# Lists existing targets or virtual devices.
# Options:
# No options
#
# Action "list avd":
# Lists existing Android Virtual Devices.
# Options:
# -0 --null Terminates lines with \0 instead of \n (e.g. for xargs -0). Only used by --compact.
# -c --compact Compact output (suitable for scripts)
#
# Action "list target":
# Lists existing targets.
# Options:
# -0 --null Terminates lines with \0 instead of \n (e.g. for xargs -0) Only used by --compact.
# -c --compact Compact output (suitable for scripts)
#
# Action "list sdk":
# Lists remote SDK repository.
# Options:
# -o --obsolete Installs obsolete packages
# --proxy-host HTTP/HTTPS proxy host (overrides settings if defined)
# --proxy-port HTTP/HTTPS proxy port (overrides settings if defined)
# -s --no-https Uses HTTP instead of HTTPS (the default) for downloads
# -u --no-ui Displays list result on console (no GUI) [Default: true]
;;
(create)
_arguments \
'1: :_android_create_entities' \
&& ret=0
# TODO Options:
# Action "create avd":
# Creates a new Android Virtual Device.
# Options:
# -c --sdcard Path to a shared SD card image, or size of a new sdcard for the new AVD
# -n --name Name of the new AVD [required]
# -a --snapshot Place a snapshots file in the AVD, to enable persistence.
# -p --path Directory where the new AVD will be created
# -f --force Forces creation (overwrites an existing AVD)
# -s --skin Skin for the new AVD
# -t --target Target ID of the new AVD [required]
#
# Action "create project":
# Creates a new Android project.
# Options:
# -n --name Project name
# -t --target Target ID of the new project [required]
# -p --path The new project's directory [required]
# -k --package Android package name for the application [required]
# -a --activity Name of the default Activity that is created [required]
#
# Action "create test-project":
# Creates a new Android project for a test package.
# Options:
# -p --path The new project's directory [required]
# -n --name Project name
# -m --main Path to directory of the app under test, relative to the test project directory [required]
#
# Action "create lib-project":
# Creates a new Android library project.
# Options:
# -n --name Project name
# -t --target Target ID of the new project [required]
# -k --package Android package name for the library [required]
# -p --path The new project's directory [required]
;;
(update)
_arguments \
'1: :_android_update_entities' \
&& ret=0
# TODO Options:
# Action "update avd":
# Updates an Android Virtual Device to match the folders of a new SDK.
# Options:
# -n --name Name of the AVD to update [required]
#
# Action "update project":
# Updates an Android project (must already have an AndroidManifest.xml).
# Options:
# -l --library Directory of an Android library to add, relative to this project's directory
# -p --path The project's directory [required]
# -n --name Project name
# -t --target Target ID to set for the project
# -s --subprojects Also updates any projects in sub-folders, such as test projects.
#
# Action "update test-project":
# Updates the Android project for a test package (must already have an AndroidManifest.xml).
# Options:
# -m --main Directory of the app under test, relative to the test project directory [required]
# -p --path The project's directory [required]
#
# Action "update lib-project":
# Updates an Android library project (must already have an AndroidManifest.xml).
# Options:
# -p --path The project's directory [required]
# -t --target Target ID to set for the project
#
# Action "update adb":
# Updates adb to support the USB devices declared in the SDK add-ons.
# Options:
# No options
#
# Action "update sdk":
# Updates the SDK by suggesting new platforms to install if available.
# Options:
# --proxy-port HTTP/HTTPS proxy port (overrides settings if defined)
# --proxy-host HTTP/HTTPS proxy host (overrides settings if defined)
# -s --no-https Uses HTTP instead of HTTPS (the default) for downloads
# -f --force Forces replacement of a package or its parts, even if something has been modified
# -u --no-ui Updates from command-line (does not display the GUI)
# -o --obsolete Installs obsolete packages
# -t --filter A filter that limits the update to the specified types of packages in the form of
# a comma-separated list of [platform, tool, platform-tool, doc, sample, extra]
# -n --dry-mode Simulates the update but does not download or install anything
;;
(move)
_arguments \
'1: :_android_move_entities' \
&& ret=0
# TODO Options:
# Action "move avd":
# Moves or renames an Android Virtual Device.
# Options:
# -p --path Path to the AVD's new directory
# -n --name Name of the AVD to move or rename [required]
# -r --rename New name of the AVD
;;
(delete)
_arguments \
'1: :_android_delete_entities' \
&& ret=0
# TODO Options:
# Action "delete avd":
# Deletes an Android Virtual Device.
# Options:
# -n --name Name of the AVD to delete [required]
;;
(display)
_arguments \
Expand Down Expand Up @@ -118,6 +237,7 @@ _android_list_entities() {
local entities; entities=(
'avd:list existing Android Virtual Devices'
'target:list existing targets'
'sdk:list remote SDK repository'
)
_describe -t entities 'entity' entities "$@"
}
Expand Down

0 comments on commit f15297f

Please sign in to comment.