@ 261105.1

220924.3.2 · 8373612bc931c5c09af97aa1f139f89b717c2d3a

add new autogenerated shell completion scripts

reading declarations

.editorconfig

@@ -50,7 +50,7 @@ insert_final_newline = true  ## Shell Scripts ################-[*.{sh,bash,fish}]+[*.sh] end_of_line = lf indent_style = tab indent_size = unset

makefile

@@ -49,6 +49,9 @@ bash_comp_dir = ${data_dir}bash-completion/completions/ # Location of fish completions: fish_comp_dir = ${data_dir}fish/vendor_completions.d/ +# Location of zsh completions:+zsh_comp_dir = ${data_dir}zsh/site-functions/+ # Location of additional gui files desktop_apps = ${data_dir}applications/ desktop_icons = ${data_dir}icons/hicolor/256x256/apps/@@ -85,6 +88,7 @@ install: 	@echo "Configuration directory:    ${DESTDIR}${hl_conf_dir}" 	@echo "Bash completions directory: ${DESTDIR}${bash_comp_dir}" 	@echo "Fish completions directory: ${DESTDIR}${fish_comp_dir}"+	@echo "Zsh completions directory:  ${DESTDIR}${zsh_comp_dir}" 	@echo  	${MKDIR} ${DESTDIR}${hl_doc_dir}@@ -109,6 +113,7 @@ install: 	${MKDIR} ${DESTDIR}${man_dir}man5/ 	${MKDIR} ${DESTDIR}${bash_comp_dir} 	${MKDIR} ${DESTDIR}${fish_comp_dir}+	${MKDIR} ${DESTDIR}${zsh_comp_dir} 	${MKDIR} ${DESTDIR}${bin_dir}  	${INSTALL_DATA} ./langDefs/*.lang ${DESTDIR}${hl_data_dir}langDefs/@@ -123,6 +128,7 @@ install:  	${INSTALL_DATA} ./sh-completion/highlight.bash ${DESTDIR}${bash_comp_dir}highlight 	${INSTALL_DATA} ./sh-completion/highlight.fish ${DESTDIR}${fish_comp_dir}+	${INSTALL_DATA} ./sh-completion/highlight.zsh ${DESTDIR}${zsh_comp_dir}_highlight  	${INSTALL_DATA} ./AUTHORS ${DESTDIR}${hl_doc_dir} 	${INSTALL_DATA} ./README* ${DESTDIR}${hl_doc_dir}@@ -192,6 +198,11 @@ clean-obj: apidocs: 	doxygen Doxyfile +completions:+	sh-completion/gen-completions bash >sh-completion/highlight.bash+	sh-completion/gen-completions fish >sh-completion/highlight.fish+	sh-completion/gen-completions zsh >sh-completion/highlight.zsh+ help: 	@echo "This makefile offers the following options:" 	@echo@@ -203,6 +214,7 @@ help: 	@echo "install-gui      Copy GUI data files to ${hl_data_dir}." 	@echo "clean            Remove object files and binaries." 	@echo "apidocs          Generate HTML API documentation using doxygen."+	@echo "completions 	Generate shell completion scripts." 	@echo "uninstall        Remove highlight files from system." 	@echo 	@echo "See src/makefile for compilation and linking options."

sh-completion/gen-completions

new file mode 100755@@ -0,0 +1,197 @@+#!/usr/bin/env lua++local argparse = require "argparse"++local parser = argparse "highlight"+   :add_help(false)++parser:argument "file"+   :args "*"++parser:option "-B --batch-recursive"+   :description "convert all matching files, searches subdirs (example: -B '*.cpp')"+parser:option "-D --data-dir"+   :description "set path to data directory"+parser:option "--config-file"+   :description "set path to a lang or theme file"+parser:option "-d --outdir"+   :description "name of output directory"+parser:flag "-h"+   :description "print help and exit"+parser:option "--help"+   :description "print help or a topic description"+   :args "?"+   :choices {"syntax", "theme", "plugin", "config", "test", "lsp"}+parser:option "-i --input"+   :description "name of single input file"+parser:option "-o --output"+   :description "name of single output file"+parser:flag "-P --progress"+   :description "print progress bar in batch mode"+parser:flag "-q --quiet"+   :description "suppress progress info in batch mode"+parser:option "-S --syntax"+   :description "specify type of source code or syntax file path"+parser:option "--syntax-by-name"+   :description "specify type of source code by given name"+parser:flag "--syntax-supported"+   :description "test if the given syntax can be loaded"+parser:flag "-v --verbose"+   :description "print debug info; repeat to show more information"+   :count "*"+parser:option "--force"+   :description "generate output if input syntax is unknown"+   :args "?"+parser:option "--list-scripts"+   :description "list installed scripts with given type"+   :choices {"langs", "themes", "plugins"}+parser:option "--list-cat"+   :description "filter the scripts by the given categories (example: --list-cat='source;script')"+parser:option "--max-size"+   :description "set maximum input file size (examples: 512M, 1G; default: 256M)"+parser:option "--plug-in"+   :description "execute Lua plug-in script; repeat option to execute multiple plug-ins"+   :count "*"+parser:option "--plug-in-param"+   :description "set plug-in input parameter"+parser:flag "--print-config"+   :description "print path configuration"+parser:flag "--print-style"+   :description "print stylesheet only (see --style-outfile)"+parser:option "--skip"+   :description "ignore listed unknown file types (Example: --skip='bak;c~;h~')"+parser:flag "--stdout"+   :description "output to stdout (batch mode, --print-style)"+parser:flag "--validate-input"+   :description "test if input is text, remove Unicode BOM"+parser:flag "--version"+   :description "print version and copyright information"+parser:option "-O --out-format"+   :description "output file in given format"+   :choices {"html", "xhtml", "latex", "tex", "odt", "rtf", "ansi", "xterm256", "truecolor", "bbcode", "pango", "svg"}+parser:option "-c --style-outfile"+   :description "name of style file or print to stdout, if 'stdout' is given as file argument"+parser:option "-e --style-infile"+   :description "to be included in style-outfile (deprecated) use a plug-in file instead"+parser:flag "-f --fragment"+   :description "omit document header and footer"+parser:option "-F --reformat"+   :description "reformats and indents output in given style"+   :choices {"allman", "gnu", "google", "horstmann", "java", "kr", "linux", "lisp", "mozilla", "otbs", "pico", "vtk", "ratliff", "stroustrup", "webkit", "whitesmith"}+parser:flag "-I --include-style"+   :description "include style definition in output file"+parser:option "-J --line-length"+   :description "line length before wrapping (see -V, -W)"+parser:option "-j --line-number-length"+   :description "line number width incl. left padding (default: 5)"+parser:option "--line-range"+   :description "output only lines from number <start> to <end>"+parser:option "-k --font"+   :description "set font (specific to output format)"+parser:option "-K --font-size"+   :description "set font size (specific to output format)"+   :args "?"+parser:flag "-l --line-numbers"+   :description "print line numbers in output file"+parser:option "-m --line-number-start"+   :description "start line numbering with cnt (assumes -l)"+parser:option "-s --style"+   :description "set colour style (theme) or theme file path"+parser:option "-t --replace-tabs"+   :description "replace tabs by <num> spaces"+parser:option "-T --doc-title"+   :description "document title"+parser:option "-u --encoding"+   :description "set output encoding which matches input file encoding; omit encoding info if set to NONE"+parser:flag "-V --wrap-simple"+   :description "wrap lines after 80 (default) characters w/o indenting function parameters and statements"+parser:flag "-W --wrap"+   :description "wrap lines after 80 (default) characters"+parser:flag "--wrap-no-numbers"+   :description "omit line numbers of wrapped lines (assumes -l)"+parser:flag "-z --zeroes"+   :description "pad line numbers with 0's"+parser:flag "--isolate"+   :description "output each syntax token separately (verbose output)"+parser:flag "--keep-injections"+   :description "output plug-in injections in spite of -f"+parser:option "--kw-case"+   :description "change case of case insensitive keywords to given case"+   :choices {"upper", "lower", "capitalize"}+parser:option "--no-trailing-nl"+   :description "omit trailing newline. If mode is empty-file, omit only for empty input"+   :args "?"+   :choices {"empty-file"}+parser:flag "--no-version-info"+   :description "omit version info comment"+parser:flag "-a --anchors"+   :description "attach anchor to line numbers"+parser:option "-y --anchor-prefix"+   :description "set anchor name prefix"+parser:flag "-N --anchor-filename"+   :description "use input file name as anchor prefix"+parser:flag "-C --print-index"+:description "print index with hyperlinks to output files"+parser:flag "-n --ordered-list"+   :description "print lines as ordered list items"+parser:option "--class-name"+   :description "set CSS class name prefix; omit class name if set to NONE"+parser:flag "--inline-css"+   :description "output CSS within each tag (verbose output)"+parser:flag "--enclose-pre"+   :description "enclose fragmented output with pre tag (assumes -f)"+parser:flag "-b --babel"+   :description "disable Babel package shorthands"+parser:flag "-r --replace-quotes"+   :description "replace double quotes by \\dq{}"+parser:flag "--beamer"+   :description "adapt output for the Beamer package"+parser:flag "--pretty-symbols"+   :description "improve appearance of brackets and other symbols"+parser:flag "--page-color"+   :description "include page color attributes"+parser:option "-x --page-size"+   :description "set page size"+   :choices {"a3", "a4", "a5", "b4", "b5", "b6", "letter"}+parser:flag "--char-styles"+   :description "include character stylesheets"+parser:flag "--height"+   :description "set image height (units allowed)"+parser:flag "--width"+   :description "set image width (see --height)"+parser:option "--canvas"+   :description "set background colour padding (default: 80)"+   :args "?"+parser:option "--ls-profile"+   :description "read LSP configuration from lsp.conf"+parser:option "--ls-delay"+   :description "set server initialization delay"+parser:option "--ls-exec"+   :description "set server executable name"+parser:option "--ls-option"+   :description "set server CLI option (can be repeated)"+   :count "*"+parser:flag "--ls-hover"+   :description "execute hover requests (HTML output only)"+parser:flag "--ls-semantic"+   :description "retrieve semantic token types (requires LSP 3.16)"+parser:option "--ls-syntax"+   :description "set syntax which is understood by the server"+parser:flag "--ls-syntax-error"+   :description "retrieve syntax error information (assumes --ls-hover or --ls-semantic)"+parser:option "--ls-workspace"+   :description "set workspace directory to init. the server"++local p = argparse "gen-completions"+p:argument "shell"+   :choices {"bash", "zsh", "fish"}++local shell = p:parse().shell++if shell == "bash" then+   io.write(parser:get_bash_complete())+elseif shell == "zsh" then+   io.write(parser:get_zsh_complete())+else+   io.write(parser:get_fish_complete())+end

sh-completion/highlight.bash

@@ -1,6 +1,173 @@-#/usr/bin/env bash+_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" -# Bash command completion script+    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+            ;;+    esac -# /usr/share/bash-completion/completions-complete -W "--out-format --anchors --anchor-filename --anchor-prefix --babel --beamer --font --font-size --batch-recursive --class-name --data-dir --replace-tabs --doc-title --enclose-pre --encoding --zeroes --force --reformat --fragment --help --input --include-style --print-index --inline-css --kw-case --line-numbers --line-length --list-scripts --line-number-length --line-number-start --ordered-list --output --outdir --page-size --char-styles --page-color --print-config --progress --quiet --replace-quotes --style --style-infile --style-outfile --syntax --validate-input --verbose --version --wrap --wrap-simple --width --height --skip --pretty-symbols --delim-cr --start-nested --print-style --no-trailing-nl --plug-in --config-file --plug-in-read --plug-in-param --wrap-no-numbers --keep-injections --stdout --no-version-info --canvas --reformat-option --line-range --base16 --list-cat --syntax-by-name --doc --no-doc --tab --css --output-dir --failsafe --src-lang --line-number --line-number-ref" highlight+    if [[ "$cur" = -* ]]; then+        COMPREPLY=($(compgen -W "$opts" -- "$cur"))+    fi+}++complete -F _highlight -o bashdefault -o default highlight

sh-completion/highlight.fish

@@ -1,73 +1,80 @@-#/usr/bin/env fish -# /usr/share/fish/completions/-# Fish command completion script--complete -c highlight -s B -l batch-recursive -d "convert all matching files, searches subdirs"-complete -c highlight -s D -l data-dir -d " set path to data directory"-complete -c highlight -l  config-file -d "set path to a lang or theme file"-complete -c highlight -s d -l outdir -d "name of output directory"-complete -c highlight -s h -l help -d "print help or a topic description"-complete -c highlight -s i -l input -d "name of single input file"-complete -c highlight -s o -l output -d "name of single output file"-complete -c highlight -s P -l progress -d "print progress bar in batch mode"-complete -c highlight -s q -l quiet -d "suppress progress info in batch mode"-complete -c highlight -s S -l syntax= -d "specify type of source code"-complete -c highlight -l  syntax-by-name -d "specify type of source code by given name"-complete -c highlight -s v -l verbose -d "print debug info"-complete -c highlight -l  force -d "generate output if input syntax is unknown"-complete -c highlight -l  list-scripts -d "list installed scripts"-complete -c highlight -l  list-cat -d "filter the scripts by the given categories"-complete -c highlight -l  plug-in -d "execute Lua plug-in script; repeat option to"-complete -c highlight -l  plug-in-param -d "set plug-in input parameter"-complete -c highlight -l  print-config -d "print path configuration"-complete -c highlight -l  print-style -d "print stylesheet only "-complete -c highlight -l  skip -d "ignore listed unknown file types"-complete -c highlight -l  stdout -d "output to stdout "-complete -c highlight -l  validate-input -d "test if input is text, remove Unicode BOM"-complete -c highlight -l  version -d "print version and copyright information"-complete -c highlight -s O -l out-format -d " output file in given format"-complete -c highlight -s c -l style-outfile -d "name of style file"-complete -c highlight -s f -l fragment -d " omit document header and footer"-complete -c highlight -s F -l reformat -d " reformats and indents output in given style"-complete -c highlight -l  reformat-option -d "apply an astyle cmd line option "-complete -c highlight -s I -l include-style -d "include style definition in output file"-complete -c highlight -s J -l line-length -d "line length before wrapping (-V, -W)"-complete -c highlight -s j -l line-number-length -d "line number width incl. left padding (default: 5)"-complete -c highlight -l  line-range -d "output only lines from number <start> to <end>"-complete -c highlight -s k -l font -d "set font (specific to output format)"-complete -c highlight -s K -l font-size -d "set font size (specific to output format)"-complete -c highlight -s l -l line-numbers -d "print line numbers in output file"-complete -c highlight -s m -l line-number-start -d " start line numbering with cnt"-complete -c highlight -s s -l style -d "set colour theme"-complete -c highlight -s t -l replace-tabs -d "replace tabs by <num> spaces"-complete -c highlight -s T -l doc-title= -d "document title"-complete -c highlight -s u -l encoding -d "set output encoding which matches input file encoding"-complete -c highlight -s V -l wrap-simple -d "wrap lines without indenting"-complete -c highlight -s W -l wrap -d "wrap lines "-complete -c highlight -l  wrap-no-numbers -d "omit line numbers of wrapped lines"-complete -c highlight -s z -l zeroes -d "pad line numbers with zeroes"-complete -c highlight -l  base16 -d "use a theme of the Base16 collection"-complete -c highlight -l  delim-cr -d "set CR as end-of-line delimiter "-complete -c highlight -l  keep-injections -d "output plug-in injections in spite of -f"-complete -c highlight -l  kw-case= -d "change case of case insensitive keywords"-complete -c highlight -l  no-trailing-nl -d "omit trailing newline"-complete -c highlight -l  no-version-info -d "omit version info comment"-complete -c highlight -s a -l anchors -d "attach anchor to line numbers"-complete -c highlight -s y -l anchor-prefix= -d "set anchor name prefix"-complete -c highlight -s N -l anchor-filename -d "use input file name as anchor prefix"-complete -c highlight -s C -l print-index -d "print index with hyperlinks to output files"-complete -c highlight -s n -l ordered-list -d "print lines as ordered list items"-complete -c highlight -l  class-name -d "set CSS class name prefix;"-complete -c highlight -l  inline-css -d "output CSS within each tag (verbose output)"-complete -c highlight -l  enclose-pre -d "enclose fragmented output with pre tag "-complete -c highlight -s b -l babel -d "disable Babel package shorthands"-complete -c highlight -s r -l replace-quotes -d "replace double quotes by \dq{}"-complete -c highlight -l  beamer -d "adapt output for the Beamer package"-complete -c highlight -l  pretty-symbols -d "improve appearance of brackets and other symbols"-complete -c highlight -l  page-color -d " include page color attributes"-complete -c highlight -s x -l page-size -d "set page size "-complete -c highlight -l  char-styles -d "include character stylesheets"-complete -c highlight -l  height -d "set image height"-complete -c highlight -l  width -d "set image width "-complete -c highlight -l  canvas -d "set background colour padding"+complete -c highlight -s B -l batch-recursive -r -d 'convert all matching files, searches subdirs (example: -B \'*.cpp\')'+complete -c highlight -s D -l data-dir -r -d 'set path to data directory'+complete -c highlight -l config-file -r -d 'set path to a lang or theme file'+complete -c highlight -s d -l outdir -r -d 'name of output directory'+complete -c highlight -s h -d 'print help and exit'+complete -c highlight -l help -xa 'syntax theme plugin config test lsp' -d 'print help or a topic description'+complete -c highlight -s i -l input -r -d 'name of single input file'+complete -c highlight -s o -l output -r -d 'name of single output file'+complete -c highlight -s P -l progress -d 'print progress bar in batch mode'+complete -c highlight -s q -l quiet -d 'suppress progress info in batch mode'+complete -c highlight -s S -l syntax -r -d 'specify type of source code or syntax file path'+complete -c highlight -l syntax-by-name -r -d 'specify type of source code by given name'+complete -c highlight -l syntax-supported -d 'test if the given syntax can be loaded'+complete -c highlight -s v -l verbose -d 'print debug info; repeat to show more information'+complete -c highlight -l force -d 'generate output if input syntax is unknown'+complete -c highlight -l list-scripts -xa 'langs themes plugins' -d 'list installed scripts with given type'+complete -c highlight -l list-cat -r -d 'filter the scripts by the given categories (example: --list-cat=\'source;script\')'+complete -c highlight -l max-size -r -d 'set maximum input file size (examples: 512M, 1G; default: 256M)'+complete -c highlight -l plug-in -r -d 'execute Lua plug-in script; repeat option to execute multiple plug-ins'+complete -c highlight -l plug-in-param -r -d 'set plug-in input parameter'+complete -c highlight -l print-config -d 'print path configuration'+complete -c highlight -l print-style -d 'print stylesheet only (see --style-outfile)'+complete -c highlight -l skip -r -d 'ignore listed unknown file types (Example: --skip=\'bak;c~;h~\')'+complete -c highlight -l stdout -d 'output to stdout (batch mode, --print-style)'+complete -c highlight -l validate-input -d 'test if input is text, remove Unicode BOM'+complete -c highlight -l version -d 'print version and copyright information'+complete -c highlight -s O -l out-format -xa 'html xhtml latex tex odt rtf ansi xterm256 truecolor bbcode pango svg' -d 'output file in given format'+complete -c highlight -s c -l style-outfile -r -d 'name of style file or print to stdout, if \'stdout\' is given as file argument'+complete -c highlight -s e -l style-infile -r -d 'to be included in style-outfile (deprecated) use a plug-in file instead'+complete -c highlight -s f -l fragment -d 'omit document header and footer'+complete -c highlight -s F -l reformat -xa 'allman gnu google horstmann java kr linux lisp mozilla otbs pico vtk ratliff stroustrup webkit whitesmith' -d 'reformats and indents output in given style'+complete -c highlight -s I -l include-style -d 'include style definition in output file'+complete -c highlight -s J -l line-length -r -d 'line length before wrapping (see -V, -W)'+complete -c highlight -s j -l line-number-length -r -d 'line number width incl'+complete -c highlight -l line-range -r -d 'output only lines from number <start> to <end>'+complete -c highlight -s k -l font -r -d 'set font (specific to output format)'+complete -c highlight -s K -l font-size -d 'set font size (specific to output format)'+complete -c highlight -s l -l line-numbers -d 'print line numbers in output file'+complete -c highlight -s m -l line-number-start -r -d 'start line numbering with cnt (assumes -l)'+complete -c highlight -s s -l style -r -d 'set colour style (theme) or theme file path'+complete -c highlight -s t -l replace-tabs -r -d 'replace tabs by <num> spaces'+complete -c highlight -s T -l doc-title -r -d 'document title'+complete -c highlight -s u -l encoding -r -d 'set output encoding which matches input file encoding; omit encoding info if set to NONE'+complete -c highlight -s V -l wrap-simple -d 'wrap lines after 80 (default) characters w/o indenting function parameters and statements'+complete -c highlight -s W -l wrap -d 'wrap lines after 80 (default) characters'+complete -c highlight -l wrap-no-numbers -d 'omit line numbers of wrapped lines (assumes -l)'+complete -c highlight -s z -l zeroes -d 'pad line numbers with 0\'s'+complete -c highlight -l isolate -d 'output each syntax token separately (verbose output)'+complete -c highlight -l keep-injections -d 'output plug-in injections in spite of -f'+complete -c highlight -l kw-case -xa 'upper lower capitalize' -d 'change case of case insensitive keywords to given case'+complete -c highlight -l no-trailing-nl -xa 'empty-file' -d 'omit trailing newline'+complete -c highlight -l no-version-info -d 'omit version info comment'+complete -c highlight -s a -l anchors -d 'attach anchor to line numbers'+complete -c highlight -s y -l anchor-prefix -r -d 'set anchor name prefix'+complete -c highlight -s N -l anchor-filename -d 'use input file name as anchor prefix'+complete -c highlight -s C -l print-index -d 'print index with hyperlinks to output files'+complete -c highlight -s n -l ordered-list -d 'print lines as ordered list items'+complete -c highlight -l class-name -r -d 'set CSS class name prefix; omit class name if set to NONE'+complete -c highlight -l inline-css -d 'output CSS within each tag (verbose output)'+complete -c highlight -l enclose-pre -d 'enclose fragmented output with pre tag (assumes -f)'+complete -c highlight -s b -l babel -d 'disable Babel package shorthands'+complete -c highlight -s r -l replace-quotes -d 'replace double quotes by \\dq{}'+complete -c highlight -l beamer -d 'adapt output for the Beamer package'+complete -c highlight -l pretty-symbols -d 'improve appearance of brackets and other symbols'+complete -c highlight -l page-color -d 'include page color attributes'+complete -c highlight -s x -l page-size -xa 'a3 a4 a5 b4 b5 b6 letter' -d 'set page size'+complete -c highlight -l char-styles -d 'include character stylesheets'+complete -c highlight -l height -d 'set image height (units allowed)'+complete -c highlight -l width -d 'set image width (see --height)'+complete -c highlight -l canvas -d 'set background colour padding (default: 80)'+complete -c highlight -l ls-profile -r -d 'read LSP configuration from lsp.conf'+complete -c highlight -l ls-delay -r -d 'set server initialization delay'+complete -c highlight -l ls-exec -r -d 'set server executable name'+complete -c highlight -l ls-option -r -d 'set server CLI option (can be repeated)'+complete -c highlight -l ls-hover -d 'execute hover requests (HTML output only)'+complete -c highlight -l ls-semantic -d 'retrieve semantic token types (requires LSP 3.16)'+complete -c highlight -l ls-syntax -r -d 'set syntax which is understood by the server'+complete -c highlight -l ls-syntax-error -d 'retrieve syntax error information (assumes --ls-hover or --ls-semantic)'+complete -c highlight -l ls-workspace -r -d 'set workspace directory to init'

sh-completion/highlight.zsh

new file mode 100644@@ -0,0 +1,93 @@+#compdef highlight++_highlight() {+  local -a options=(+    {-B,--batch-recursive}"[convert all matching files, searches subdirs (example\: -B '*.cpp')]: :_files"+    {-D,--data-dir}"[set path to data directory]: :_files"+    "--config-file[set path to a lang or theme file]: :_files"+    {-d,--outdir}"[name of output directory]: :_files"+    "-h[print help and exit]"+    "--help[print help or a topic description]: :(syntax theme plugin config test lsp)"+    {-i,--input}"[name of single input file]: :_files"+    {-o,--output}"[name of single output file]: :_files"+    {-P,--progress}"[print progress bar in batch mode]"+    {-q,--quiet}"[suppress progress info in batch mode]"+    {-S,--syntax}"[specify type of source code or syntax file path]: :_files"+    "--syntax-by-name[specify type of source code by given name]: :_files"+    "--syntax-supported[test if the given syntax can be loaded]"+    "*"{-v,--verbose}"[print debug info; repeat to show more information]"+    "--force[generate output if input syntax is unknown]: :_files"+    "--list-scripts[list installed scripts with given type]: :(langs themes plugins)"+    "--list-cat[filter the scripts by the given categories (example\: --list-cat='source;script')]: :_files"+    "--max-size[set maximum input file size (examples\: 512M, 1G; default\: 256M)]: :_files"+    "*--plug-in[execute Lua plug-in script; repeat option to execute multiple plug-ins]: :_files"+    "--plug-in-param[set plug-in input parameter]: :_files"+    "--print-config[print path configuration]"+    "--print-style[print stylesheet only (see --style-outfile)]"+    "--skip[ignore listed unknown file types (Example\: --skip='bak;c~;h~')]: :_files"+    "--stdout[output to stdout (batch mode, --print-style)]"+    "--validate-input[test if input is text, remove Unicode BOM]"+    "--version[print version and copyright information]"+    {-O,--out-format}"[output file in given format]: :(html xhtml latex tex odt rtf ansi xterm256 truecolor bbcode pango svg)"+    {-c,--style-outfile}"[name of style file or print to stdout, if 'stdout' is given as file argument]: :_files"+    {-e,--style-infile}"[to be included in style-outfile (deprecated) use a plug-in file instead]: :_files"+    {-f,--fragment}"[omit document header and footer]"+    {-F,--reformat}"[reformats and indents output in given style]: :(allman gnu google horstmann java kr linux lisp mozilla otbs pico vtk ratliff stroustrup webkit whitesmith)"+    {-I,--include-style}"[include style definition in output file]"+    {-J,--line-length}"[line length before wrapping (see -V, -W)]: :_files"+    {-j,--line-number-length}"[line number width incl]: :_files"+    "--line-range[output only lines from number <start> to <end>]: :_files"+    {-k,--font}"[set font (specific to output format)]: :_files"+    {-K,--font-size}"[set font size (specific to output format)]: :_files"+    {-l,--line-numbers}"[print line numbers in output file]"+    {-m,--line-number-start}"[start line numbering with cnt (assumes -l)]: :_files"+    {-s,--style}"[set colour style (theme) or theme file path]: :_files"+    {-t,--replace-tabs}"[replace tabs by <num> spaces]: :_files"+    {-T,--doc-title}"[document title]: :_files"+    {-u,--encoding}"[set output encoding which matches input file encoding; omit encoding info if set to NONE]: :_files"+    {-V,--wrap-simple}"[wrap lines after 80 (default) characters w/o indenting function parameters and statements]"+    {-W,--wrap}"[wrap lines after 80 (default) characters]"+    "--wrap-no-numbers[omit line numbers of wrapped lines (assumes -l)]"+    {-z,--zeroes}"[pad line numbers with 0's]"+    "--isolate[output each syntax token separately (verbose output)]"+    "--keep-injections[output plug-in injections in spite of -f]"+    "--kw-case[change case of case insensitive keywords to given case]: :(upper lower capitalize)"+    "--no-trailing-nl[omit trailing newline]: :(empty-file)"+    "--no-version-info[omit version info comment]"+    {-a,--anchors}"[attach anchor to line numbers]"+    {-y,--anchor-prefix}"[set anchor name prefix]: :_files"+    {-N,--anchor-filename}"[use input file name as anchor prefix]"+    {-C,--print-index}"[print index with hyperlinks to output files]"+    {-n,--ordered-list}"[print lines as ordered list items]"+    "--class-name[set CSS class name prefix; omit class name if set to NONE]: :_files"+    "--inline-css[output CSS within each tag (verbose output)]"+    "--enclose-pre[enclose fragmented output with pre tag (assumes -f)]"+    {-b,--babel}"[disable Babel package shorthands]"+    {-r,--replace-quotes}"[replace double quotes by \dq{}]"+    "--beamer[adapt output for the Beamer package]"+    "--pretty-symbols[improve appearance of brackets and other symbols]"+    "--page-color[include page color attributes]"+    {-x,--page-size}"[set page size]: :(a3 a4 a5 b4 b5 b6 letter)"+    "--char-styles[include character stylesheets]"+    "--height[set image height (units allowed)]"+    "--width[set image width (see --height)]"+    "--canvas[set background colour padding (default\: 80)]: :_files"+    "--ls-profile[read LSP configuration from lsp.conf]: :_files"+    "--ls-delay[set server initialization delay]: :_files"+    "--ls-exec[set server executable name]: :_files"+    "*--ls-option[set server CLI option (can be repeated)]: :_files"+    "--ls-hover[execute hover requests (HTML output only)]"+    "--ls-semantic[retrieve semantic token types (requires LSP 3.16)]"+    "--ls-syntax[set syntax which is understood by the server]: :_files"+    "--ls-syntax-error[retrieve syntax error information (assumes --ls-hover or --ls-semantic)]"+    "--ls-workspace[set workspace directory to init]: :_files"+  )+  _arguments -s -S \+    $options \+    "*: :_files" \+    && return 0++  return 1+}++_highlight