mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-21 15:23:19 +01: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:
parent
e19bebc1f6
commit
b6b9d3a629
@ -12,6 +12,7 @@
|
||||
## Other
|
||||
|
||||
- Various bash completion improvements, see #2310 (@scop)
|
||||
- Disable completion of `cache` subcommand, see #2399 (@cyqsimon)
|
||||
|
||||
## 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('-V', 'V', [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
|
||||
}
|
||||
'{{PROJECT_EXECUTABLE}};cache' {
|
||||
|
5
assets/completions/bat.bash.in
vendored
5
assets/completions/bat.bash.in
vendored
@ -184,6 +184,7 @@ _bat() {
|
||||
fi
|
||||
|
||||
_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}}
|
||||
|
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
|
||||
|
||||
# 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
|
||||
|
||||
|
26
assets/completions/bat.zsh.in
vendored
26
assets/completions/bat.zsh.in
vendored
@ -80,20 +80,14 @@ _{{PROJECT_EXECUTABLE}}_main() {
|
||||
esac
|
||||
}
|
||||
|
||||
# first positional argument
|
||||
if (( ${#words} == 2 )); then
|
||||
local -a subcommands
|
||||
subcommands=('cache:Modify the syntax-definition and theme cache')
|
||||
_describe subcommand subcommands
|
||||
_{{PROJECT_EXECUTABLE}}_main
|
||||
else
|
||||
case $words[2] in
|
||||
cache)
|
||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand
|
||||
;;
|
||||
case $words[2] in
|
||||
cache)
|
||||
## Completion of the 'cache' command itself is removed for better UX
|
||||
## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802
|
||||
_{{PROJECT_EXECUTABLE}}_cache_subcommand
|
||||
;;
|
||||
|
||||
*)
|
||||
_{{PROJECT_EXECUTABLE}}_main
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
*)
|
||||
_{{PROJECT_EXECUTABLE}}_main
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user