summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2022-04-03 18:34:01 +0200
committerMikael Magnusson <mikachu@gmail.com>2022-04-03 18:34:01 +0200
commit6900dded09ddfdfda14c68093256db9021720d23 (patch)
tree036b00814895c58f886dc0fe998b5ef5ae95fbcc
parenta07d0109813fc8ec1722e19d759c417f7b456580 (diff)
downloadzsh-6900dded09ddfdfda14c68093256db9021720d23.tar.gz
zsh-6900dded09ddfdfda14c68093256db9021720d23.tar.xz
zsh-6900dded09ddfdfda14c68093256db9021720d23.zip
49965: _adb: use $CURRENT instead of $#words
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_adb12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e40bfa20..dc7b1174b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
 	* 49964: Completion/Unix/Command/_adb: _adb: Complete services
 	for start/stop
 
+	* 49965: Completion/Unix/Command/_adb: _adb: use $CURRENT instead
+	of $#words
+
 2022-04-02  dana  <dana@dana.is>
 
 	* unposted (see 48073): Completion/Zsh/Command/_fc: Complete
diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index 8d3eec542..b8b2470a6 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -176,7 +176,7 @@ _adb_device_specification () {
 
 (( $+functions[_adb_dispatch_shell] )) ||
 _adb_dispatch_shell () {
-  if [[ ${#words} -le 2 ]]
+  if [[ $CURRENT -le 2 ]]
   then
     (( $+functions[_adb_shell_commands_handler] )) && _adb_shell_commands_handler
     return
@@ -272,7 +272,7 @@ _adb_intent_handler () {
 
 (( $+functions[_adb_activity_manager_handler] )) ||
 _adb_activity_manager_handler () {
-  if [[ ${#words} -le 3 ]]
+  if [[ $CURRENT -le 3 ]]
   then
     _wanted am_argument expl 'am argument' compadd start startservice broadcast instrument profile
     return
@@ -379,12 +379,12 @@ _adb_dispatch_install () {
 
 (( $+functions[_adb_dispatch_push] )) ||
 _adb_dispatch_push () {
-  if [[ ${#words} -gt 3 ]] 
+  if [[ $CURRENT -gt 3 ]] 
   then
     _message -r "Notice: you can only push a single item at a time"
     return
   fi 
-  if [[ ${#words} -gt 2 ]]
+  if [[ $CURRENT -gt 2 ]]
   then
     _arguments '*: :_adb_remote_folder'
   else
@@ -394,12 +394,12 @@ _adb_dispatch_push () {
 
 (( $+functions[_adb_dispatch_pull] )) ||
 _adb_dispatch_pull () {
-  if [[ ${#words} -gt 3 ]] 
+  if [[ $CURRENT -gt 3 ]] 
   then
     _message -r "Notice: you can only pull a single item at a time"
     return
   fi 
-  if [[ ${#words} -gt 2 ]]
+  if [[ $CURRENT -gt 2 ]]
   then
     _arguments '*:local file/folder:_files'
   else