aboutsummaryrefslogtreecommitdiff
path: root/data/bash_completion.tpl
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-04-12 09:50:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-04-12 09:52:10 -0700
commit499c91dd9698c15bac2667a90b2b3ddc1a0f1930 (patch)
treef43f6216429cc1c342681be4e77bd65b6945ebe8 /data/bash_completion.tpl
parentc3d0cc9b8e9853f7435328a0f07bc6edccffd225 (diff)
downloadpandoc-499c91dd9698c15bac2667a90b2b3ddc1a0f1930.tar.gz
Fix bash completion for `--print-default-data-file`.
Previously this looked in the filesystem, even if pandoc was compiled with `embed_data_files` (and sometimes it looked in a nonexistent build directory). Now the bash completion script just includes a hard-coded list of data file names. See #4549.
Diffstat (limited to 'data/bash_completion.tpl')
-rw-r--r--data/bash_completion.tpl6
1 files changed, 3 insertions, 3 deletions
diff --git a/data/bash_completion.tpl b/data/bash_completion.tpl
index c9145c06c..60140a1e4 100644
--- a/data/bash_completion.tpl
+++ b/data/bash_completion.tpl
@@ -4,7 +4,7 @@
_pandoc()
{
- local cur prev opts lastc informats outformats datadir
+ local cur prev opts lastc informats outformats datafiles
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@@ -14,7 +14,7 @@ _pandoc()
informats="%s"
outformats="%s"
highlight_styles="%s"
- datadir="%s"
+ datafiles="%s"
case "${prev}" in
--from|-f|--read|-r)
@@ -34,7 +34,7 @@ _pandoc()
return 0
;;
--print-default-data-file)
- COMPREPLY=( $(compgen -W "reference.odt reference.docx $(find ${datadir} | sed -e 's/.*\/data\///')" -- ${cur}) )
+ COMPREPLY=( $(compgen -W "${datafiles}" -- ${cur}) )
return 0
;;
--wrap)