mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-10-31 15:12:12 +00:00 
			
		
		
		
	Disable completion of cache subcommand (#2399)
				
					
				
			* Disable completion of `cache` subcommand * Fully removed completion code for `cache` * Add to changelog
This commit is contained in:
		| @@ -12,6 +12,7 @@ | |||||||
| ## Other | ## Other | ||||||
|  |  | ||||||
| - Various bash completion improvements, see #2310 (@scop) | - Various bash completion improvements, see #2310 (@scop) | ||||||
|  | - Disable completion of `cache` subcommand, see #2399 (@cyqsimon) | ||||||
|  |  | ||||||
| ## Syntaxes | ## Syntaxes | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								assets/completions/_bat.ps1.in
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								assets/completions/_bat.ps1.in
									
									
									
									
										vendored
									
									
								
							| @@ -68,7 +68,8 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script | |||||||
|             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print this help message.') |             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print this help message.') | ||||||
|             [CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Show version information.') |             [CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Show version information.') | ||||||
|             [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Show version information.') |             [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Show version information.') | ||||||
|             [CompletionResult]::new('cache', 'cache', [CompletionResultType]::ParameterValue, 'Modify the syntax-definition and theme cache') |             ## Completion of the 'cache' command itself is removed for better UX | ||||||
|  |             ## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 | ||||||
|             break |             break | ||||||
|         } |         } | ||||||
|         '{{PROJECT_EXECUTABLE}};cache' { |         '{{PROJECT_EXECUTABLE}};cache' { | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								assets/completions/bat.bash.in
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								assets/completions/bat.bash.in
									
									
									
									
										vendored
									
									
								
							| @@ -184,6 +184,7 @@ _bat() { | |||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	_filedir | 	_filedir | ||||||
| 	((cword == 1)) && COMPREPLY+=($(compgen -W cache -- "$cur")) |  | ||||||
| 	 | 	 | ||||||
|  | 	## Completion of the 'cache' command itself is removed for better UX | ||||||
|  | 	## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 | ||||||
| } && complete -F _bat {{PROJECT_EXECUTABLE}} | } && complete -F _bat {{PROJECT_EXECUTABLE}} | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								assets/completions/bat.fish.in
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								assets/completions/bat.fish.in
									
									
									
									
										vendored
									
									
								
							| @@ -198,7 +198,8 @@ complete -c $bat -s V -l version -f -d "Show version information" -n __fish_is_f | |||||||
| complete -c $bat -l wrap -x -a "$wrap_opts" -d "Text-wrapping mode" -n __bat_no_excl_args | complete -c $bat -l wrap -x -a "$wrap_opts" -d "Text-wrapping mode" -n __bat_no_excl_args | ||||||
|  |  | ||||||
| # Sub-command 'cache' completions | # Sub-command 'cache' completions | ||||||
| complete -c $bat -a cache -d "Modify the syntax/language definition cache" -n __fish_use_subcommand | ## Completion of the 'cache' command itself is removed for better UX | ||||||
|  | ## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 | ||||||
|  |  | ||||||
| complete -c $bat -l build -f -d "Parse new definitions into cache" -n __bat_cache_no_excl | complete -c $bat -l build -f -d "Parse new definitions into cache" -n __bat_cache_no_excl | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										26
									
								
								assets/completions/bat.zsh.in
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								assets/completions/bat.zsh.in
									
									
									
									
										vendored
									
									
								
							| @@ -80,20 +80,14 @@ _{{PROJECT_EXECUTABLE}}_main() { | |||||||
|     esac |     esac | ||||||
| } | } | ||||||
|  |  | ||||||
| # first positional argument | case $words[2] in | ||||||
| if (( ${#words} == 2 )); then |     cache) | ||||||
|     local -a subcommands |         ## Completion of the 'cache' command itself is removed for better UX | ||||||
|     subcommands=('cache:Modify the syntax-definition and theme cache') |         ## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 | ||||||
|     _describe subcommand subcommands |         _{{PROJECT_EXECUTABLE}}_cache_subcommand | ||||||
|     _{{PROJECT_EXECUTABLE}}_main |     ;; | ||||||
| else |  | ||||||
|     case $words[2] in |  | ||||||
|         cache) |  | ||||||
|             _{{PROJECT_EXECUTABLE}}_cache_subcommand |  | ||||||
|         ;; |  | ||||||
|  |  | ||||||
|         *) |     *) | ||||||
|             _{{PROJECT_EXECUTABLE}}_main |         _{{PROJECT_EXECUTABLE}}_main | ||||||
|         ;; |     ;; | ||||||
|     esac | esac | ||||||
| fi |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user