#42 android: Complete options for the 'delete' command
This commit is contained in:
		
							parent
							
								
									f5c8471e6f
								
							
						
					
					
						commit
						c1c79d4549
					
				
							
								
								
									
										31
									
								
								_android
								
								
								
								
							
							
						
						
									
										31
									
								
								_android
								
								
								
								
							| 
						 | 
					@ -91,7 +91,7 @@ _android() {
 | 
				
			||||||
          esac
 | 
					          esac
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        (create)
 | 
					        (create)
 | 
				
			||||||
          _arguments \
 | 
					          _arguments -C \
 | 
				
			||||||
            '1: :_android_create_entities' \
 | 
					            '1: :_android_create_entities' \
 | 
				
			||||||
            '*::create-arg:->create-args' \
 | 
					            '*::create-arg:->create-args' \
 | 
				
			||||||
          && ret=0
 | 
					          && ret=0
 | 
				
			||||||
| 
						 | 
					@ -138,8 +138,9 @@ _android() {
 | 
				
			||||||
          esac
 | 
					          esac
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        (update)
 | 
					        (update)
 | 
				
			||||||
          _arguments \
 | 
					          _arguments -C \
 | 
				
			||||||
            '1: :_android_update_entities' \
 | 
					            '1: :_android_update_entities' \
 | 
				
			||||||
 | 
					            '*::update-arg:->update-args' \
 | 
				
			||||||
          && ret=0
 | 
					          && ret=0
 | 
				
			||||||
          # TODO Options:
 | 
					          # TODO Options:
 | 
				
			||||||
          # Action "update avd":
 | 
					          # Action "update avd":
 | 
				
			||||||
| 
						 | 
					@ -175,8 +176,9 @@ _android() {
 | 
				
			||||||
          #   -n --dry-mode   Simulates the update but does not download or install anything
 | 
					          #   -n --dry-mode   Simulates the update but does not download or install anything
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        (move)
 | 
					        (move)
 | 
				
			||||||
          _arguments \
 | 
					          _arguments -C \
 | 
				
			||||||
            '1: :_android_move_entities' \
 | 
					            '1: :_android_move_entities' \
 | 
				
			||||||
 | 
					            '*::move-arg:->move-args' \
 | 
				
			||||||
      && ret=0
 | 
					      && ret=0
 | 
				
			||||||
          # TODO Options:
 | 
					          # TODO Options:
 | 
				
			||||||
          # Action "move avd":
 | 
					          # Action "move avd":
 | 
				
			||||||
| 
						 | 
					@ -185,12 +187,21 @@ _android() {
 | 
				
			||||||
          #   -r --rename   New name of the AVD
 | 
					          #   -r --rename   New name of the AVD
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        (delete)
 | 
					        (delete)
 | 
				
			||||||
          _arguments \
 | 
					          _arguments -C \
 | 
				
			||||||
            '1: :_android_delete_entities' \
 | 
					            '1: :_android_delete_entities' \
 | 
				
			||||||
 | 
					            '*::delete-arg:->delete-args' \
 | 
				
			||||||
          && ret=0
 | 
					          && ret=0
 | 
				
			||||||
          # TODO Options:
 | 
					          case "$state" in
 | 
				
			||||||
          # Action "delete avd":
 | 
					            (delete-args)
 | 
				
			||||||
          #   -n --name     Name of the AVD to delete [required]
 | 
					              case $words[1] in
 | 
				
			||||||
 | 
					                (avd)
 | 
				
			||||||
 | 
					                  _arguments \
 | 
				
			||||||
 | 
					                    '(-n --name)'{-n,--name}'[name of the AVD to delete]: :_android_avd_names' \
 | 
				
			||||||
 | 
					                  && ret=0
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					              esac
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					          esac
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        (display)
 | 
					        (display)
 | 
				
			||||||
          _arguments \
 | 
					          _arguments \
 | 
				
			||||||
| 
						 | 
					@ -282,4 +293,10 @@ _android_targets() {
 | 
				
			||||||
  _describe -t targets 'target' 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 "$@"
 | 
					_android "$@"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue