1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
_highlight() {
local IFS=$' \t\n'
local args cur prev cmd opts arg
args=("${COMP_WORDS[@]}")
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-B --batch-recursive -D --data-dir --config-file -d --outdir -h --help -i --input -o --output -P --progress -q --quiet -S --syntax --syntax-by-name --syntax-supported -v --verbose --force --list-scripts --list-cat --max-size --plug-in --plug-in-param --print-config --print-style --skip --stdout --validate-input --version -O --out-format -c --style-outfile -e --style-infile -f --fragment -F --reformat -I --include-style -J --line-length -j --line-number-length --line-range -k --font -K --font-size -l --line-numbers -m --line-number-start -s --style -t --replace-tabs -T --doc-title -u --encoding -V --wrap-simple -W --wrap --wrap-no-numbers -z --zeroes --isolate --keep-injections --kw-case --no-trailing-nl --no-version-info -a --anchors -y --anchor-prefix -N --anchor-filename -C --print-index -n --ordered-list --class-name --inline-css --enclose-pre -b --babel -r --replace-quotes --beamer --pretty-symbols --page-color -x --page-size --char-styles --height --width --canvas --ls-profile --ls-delay --ls-exec --ls-option --ls-hover --ls-semantic --ls-syntax --ls-syntax-error --ls-workspace --ls-legacy --service-mode"
case "$prev" in
-B|--batch-recursive)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-D|--data-dir)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--config-file)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-d|--outdir)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--help)
COMPREPLY=($(compgen -W "syntax theme plugin config test lsp" -- "$cur"))
return 0
;;
-i|--input)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-o|--output)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-S|--syntax)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--syntax-by-name)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--list-scripts)
COMPREPLY=($(compgen -W "langs themes plugins" -- "$cur"))
return 0
;;
--list-cat)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--max-size)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--plug-in)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--plug-in-param)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--skip)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-O|--out-format)
COMPREPLY=($(compgen -W "html xhtml latex tex odt rtf ansi xterm256 truecolor bbcode pango svg" -- "$cur"))
return 0
;;
-c|--style-outfile)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-e|--style-infile)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-F|--reformat)
COMPREPLY=($(compgen -W "allman gnu google horstmann java kr linux lisp mozilla otbs pico vtk ratliff stroustrup webkit whitesmith" -- "$cur"))
return 0
;;
-J|--line-length)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-j|--line-number-length)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--line-range)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-k|--font)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-m|--line-number-start)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-s|--style)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-t|--replace-tabs)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-T|--doc-title)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-u|--encoding)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--kw-case)
COMPREPLY=($(compgen -W "upper lower capitalize" -- "$cur"))
return 0
;;
--no-trailing-nl)
COMPREPLY=($(compgen -W "empty-file" -- "$cur"))
return 0
;;
-y|--anchor-prefix)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--class-name)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
-x|--page-size)
COMPREPLY=($(compgen -W "a3 a4 a5 b4 b5 b6 letter" -- "$cur"))
return 0
;;
--ls-profile)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-delay)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-exec)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-option)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-syntax)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-workspace)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--ls-legacy)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
--service-mode)
COMPREPLY=($(compgen -f -- "$cur"))
return 0
;;
esac
if [[ "$cur" = -* ]]; then
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
fi
}
complete -F _highlight -o bashdefault -o default highlight
|