mirror of
				git://git.code.sf.net/p/zsh/code
				synced 2025-10-31 06:00:54 +01:00 
			
		
		
		
	52112: use '_normal -p subcmd' to complete only external command
This commit is contained in:
		
							parent
							
								
									9ff1b2810e
								
							
						
					
					
						commit
						c0caef5613
					
				
					 15 changed files with 28 additions and 16 deletions
				
			
		|  | @ -33,7 +33,7 @@ case $variant in | |||
|     ;; | ||||
| esac | ||||
| 
 | ||||
| args+=( '1:new root directory:_directories' '*:::command:_normal' ) | ||||
| args+=( '1:new root directory:_directories' '*::: : _normal -p $service' ) | ||||
| 
 | ||||
| _arguments -s -S : $args && ret=0 | ||||
| 
 | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ _arguments -C \ | |||
|   '(-)--help[display help information]' \ | ||||
|   '(-)--version[display version information]' \ | ||||
|   "--no-init[don't set terminal init string]" \ | ||||
|   '--ssh=[specify ssh command to setup session]:ssh command:_normal' \ | ||||
|   '--ssh=[specify ssh command to setup session]:ssh command: _cmdstring' \ | ||||
|   '--port=[specify server-side port range]:port:_sequence -n 2 -s \: _ports' \ | ||||
|   '(-a -n)--predict=[control speculative local echo]:mode:(adaptive always never)' \ | ||||
|   '(--predict -n)-a[synonym for --predict=always]' \ | ||||
|  | @ -22,7 +22,7 @@ _arguments -C \ | |||
|   '--local[run mosh-server locally without using ssh]' \ | ||||
|   '--experimental-remote-ip=[select method for discovering remote IP address to use for mosh]:method:(local remote proxy)' \ | ||||
|   '1:remote host name:->userhost' \ | ||||
|   '*:::args:_normal' && ret=0 | ||||
|   '*::: : _normal -p $service' && ret=0 | ||||
| 
 | ||||
| case $state in | ||||
|   userhost) | ||||
|  |  | |||
|  | @ -196,7 +196,7 @@ if [[ -n $state ]]; then | |||
|   if [[ $line[1] = exec ]]; then | ||||
|     shift words | ||||
|     (( CURRENT-- )) | ||||
|     _normal | ||||
|     _normal -p $service && return | ||||
|   elif [[ $line[1] = (flush|monitor) ]]; then | ||||
|     sequential=() | ||||
|   fi | ||||
|  |  | |||
|  | @ -107,7 +107,7 @@ if [[ -n $state ]]; then | |||
|       elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then | ||||
| 	  _message "no more parameters" | ||||
|       else | ||||
| 	  _normal | ||||
| 	  _normal -p $service | ||||
|       fi | ||||
|     ;; | ||||
|     attached-sessions) | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ case $OSTYPE in | |||
|       '-F[send output to specified named pipe]:fifo:_files -g "*(p)"' | ||||
|       '-t+[specify interval of data flushing]:interval (seconds)' | ||||
|       '-k[log keys sent to the program as well as output]' | ||||
|       '*:::arguments: _normal' | ||||
|       '*:::arguments: _normal $service' | ||||
|     ) | ||||
|   ;| | ||||
|   darwin*|freebsd*) | ||||
|  |  | |||
|  | @ -136,7 +136,7 @@ _ssh () { | |||
|       '(-k -c)-s[force sh-style shell]' \ | ||||
|       '-t+[set default maximum lifetime for identities]: :_numbers -u seconds "maximum lifetime" \:s\:seconds m\:minutes h\:hours d\:days w\:weeks' \ | ||||
|       '-v[verbose mode]' \ | ||||
|       '*::command: _normal' | ||||
|       '*::command: _normal -p $service' | ||||
|     return | ||||
|     ;; | ||||
|   ssh-keygen) | ||||
|  | @ -738,7 +738,7 @@ _ssh () { | |||
|       local -a _comp_priv_prefix | ||||
|       shift 1 words | ||||
|       (( CURRENT-- )) | ||||
|       _normal | ||||
|       _normal -p $service | ||||
|       return | ||||
|       ;; | ||||
|     destinations) | ||||
|  |  | |||
|  | @ -27,6 +27,6 @@ for ((i=1;i<=3;i++)); do | |||
|     "(${short[i]})${long[i]}=${(e)opt}" | ||||
|   ) | ||||
| done | ||||
| (( CURRENT > 2 )) && args+=( '*::command:_normal' ) | ||||
| (( CURRENT > 2 )) && args+=( '*::command: _normal -p $service' ) | ||||
| 
 | ||||
| _arguments -s -S $args | ||||
|  |  | |||
|  | @ -17,4 +17,4 @@ _arguments -S -A "-" $args \ | |||
|   '(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \ | ||||
|   '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time' \ | ||||
|   '1: :_numbers -f -u seconds duration :s:seconds m:minutes h:hours d:days' \ | ||||
|   '*:::command:_normal' | ||||
|   '*:::command: _normal -p $service' | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue