mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 18:26:36 +00:00
Update bash_completion.tpl
- Specify local scope for highlight_styles; prevents global namespace pollution when sourcing completion from a file rather than adding `eval "$(pandoc --bash-completion)"` to .bashrc - Add argument completion for --print-highlight-style, --eol, and --markdown-headings
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
_pandoc()
|
||||
{
|
||||
local cur prev opts lastc informats outformats datafiles
|
||||
local cur prev opts lastc informats outformats highlight_styles datafiles
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
@@ -57,10 +57,18 @@ _pandoc()
|
||||
COMPREPLY=( $(compgen -W "section chapter part" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
--highlight-style)
|
||||
--highlight-style|--print-highlight-style)
|
||||
COMPREPLY=( $(compgen -W "${highlight_styles}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
--eol)
|
||||
COMPREPLY=( $(compgen -W "crlf lf native" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
--markdown-headings)
|
||||
COMPREPLY=( $(compgen -W "setext atx" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user