mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 10:11:07 +00:00
Add --style argument bash completion
This commit is contained in:
parent
46bf3c1e9a
commit
c816188f97
25
assets/completions/bat.bash.in
vendored
25
assets/completions/bat.bash.in
vendored
@ -54,7 +54,6 @@ _bat() {
|
|||||||
--terminal-width | \
|
--terminal-width | \
|
||||||
-m | --map-syntax | \
|
-m | --map-syntax | \
|
||||||
--ignored-suffix | \
|
--ignored-suffix | \
|
||||||
--style | \
|
|
||||||
--list-themes | \
|
--list-themes | \
|
||||||
--line-range | \
|
--line-range | \
|
||||||
-L | --list-languages | \
|
-L | --list-languages | \
|
||||||
@ -96,6 +95,30 @@ _bat() {
|
|||||||
compopt -o filenames # for escaping
|
compopt -o filenames # for escaping
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
--style)
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
local -a styles=(
|
||||||
|
default
|
||||||
|
full
|
||||||
|
auto
|
||||||
|
plain
|
||||||
|
changes
|
||||||
|
header
|
||||||
|
header-filename
|
||||||
|
header-filesize
|
||||||
|
grid
|
||||||
|
rule
|
||||||
|
numbers
|
||||||
|
snip
|
||||||
|
)
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
if declare -F _comp_delimited >/dev/null 2>&1; then
|
||||||
|
# bash-completion > 2.11
|
||||||
|
_comp_delimited , -W '"${styles[@]}"'
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W '${styles[@]}' -- "$cur"))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$split && return 0
|
$split && return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user