mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Add command to install shell completion (#309)
add autocompletion files to contrib/ curl -o contrib/autocomplete.zsh https://raw.githubusercontent.com/urfave/cli/master/autocomplete/zsh_autocomplete curl -o contrib/autocomplete.sh https://raw.githubusercontent.com/urfave/cli/master/autocomplete/bash_autocomplete add powershell add `tea meta autocomplete` closes #86 update docs Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/309 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: 6543 <6543@obermui.de> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
		
							
								
								
									
										23
									
								
								contrib/autocomplete.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								contrib/autocomplete.zsh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| #compdef $PROG | ||||
|  | ||||
| _cli_zsh_autocomplete() { | ||||
|  | ||||
|   local -a opts | ||||
|   local cur | ||||
|   cur=${words[-1]} | ||||
|   if [[ "$cur" == "-"* ]]; then | ||||
|     opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}") | ||||
|   else | ||||
|     opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}") | ||||
|   fi | ||||
|  | ||||
|   if [[ "${opts[1]}" != "" ]]; then | ||||
|     _describe 'values' opts | ||||
|   else | ||||
|     _files | ||||
|   fi | ||||
|  | ||||
|   return | ||||
| } | ||||
|  | ||||
| compdef _cli_zsh_autocomplete $PROG | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin