aboutsummaryrefslogtreecommitdiff
path: root/data/bash_completion.tpl
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-07 15:46:46 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-12-07 17:37:27 +0100
commitb0733190b06b3684f0994809b17543033c5c00ca (patch)
tree45b92b6c0fe4e4daaca506118ee7cef2a116b7dc /data/bash_completion.tpl
parenta197341252a6149bb1a3234ffcca915fb4ed1498 (diff)
downloadpandoc-b0733190b06b3684f0994809b17543033c5c00ca.tar.gz
Fixed bash completion for filenames with spaces.
Closes #2749.
Diffstat (limited to 'data/bash_completion.tpl')
-rw-r--r--data/bash_completion.tpl24
1 files changed, 20 insertions, 4 deletions
diff --git a/data/bash_completion.tpl b/data/bash_completion.tpl
index 6d7e17215..45fe03f9f 100644
--- a/data/bash_completion.tpl
+++ b/data/bash_completion.tpl
@@ -1,5 +1,3 @@
-#!/bin/bash
-
# This script enables bash autocompletion for pandoc. To enable
# bash completion, add this to your .bashrc:
# eval "$(pandoc --bash-completion)"
@@ -15,6 +13,7 @@ _pandoc()
opts="%s"
informats="%s"
outformats="%s"
+ highlight_styles="%s"
datadir="%s"
case "${prev}" in
@@ -38,8 +37,24 @@ _pandoc()
COMPREPLY=( $(compgen -W "reference.odt reference.docx $(find ${datadir} | sed -e 's/.*\/data\///')" -- ${cur}) )
return 0
;;
+ --wrap)
+ COMPREPLY=( $(compgen -W "auto none preserve" -- ${cur}) )
+ return 0
+ ;;
+ --track-changes)
+ COMPREPLY=( $(compgen -W "accept reject all" -- ${cur}) )
+ return 0
+ ;;
+ --reference-location)
+ COMPREPLY=( $(compgen -W "block section document" -- ${cur}) )
+ return 0
+ ;;
+ --top-level-division)
+ COMPREPLY=( $(compgen -W "section chapter part" -- ${cur}) )
+ return 0
+ ;;
--highlight-style)
- COMPREPLY=( $(compgen -W "pygments tango espresso zenburn kate monochrome haddock" -- ${cur}) )
+ COMPREPLY=( $(compgen -W "${highlight_styles}" -- ${cur}) )
return 0
;;
*)
@@ -52,7 +67,8 @@ _pandoc()
return 0
;;
*)
- COMPREPLY=( $(compgen -f ${cur}) )
+ local IFS=$'\n'
+ COMPREPLY=( $(compgen -X '' -f ${cur}) )
return 0
;;
esac