parent
a197341252
commit
b0733190b0
2 changed files with 23 additions and 6 deletions
|
@ -1,5 +1,3 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This script enables bash autocompletion for pandoc. To enable
|
# This script enables bash autocompletion for pandoc. To enable
|
||||||
# bash completion, add this to your .bashrc:
|
# bash completion, add this to your .bashrc:
|
||||||
# eval "$(pandoc --bash-completion)"
|
# eval "$(pandoc --bash-completion)"
|
||||||
|
@ -15,6 +13,7 @@ _pandoc()
|
||||||
opts="%s"
|
opts="%s"
|
||||||
informats="%s"
|
informats="%s"
|
||||||
outformats="%s"
|
outformats="%s"
|
||||||
|
highlight_styles="%s"
|
||||||
datadir="%s"
|
datadir="%s"
|
||||||
|
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
|
@ -38,8 +37,24 @@ _pandoc()
|
||||||
COMPREPLY=( $(compgen -W "reference.odt reference.docx $(find ${datadir} | sed -e 's/.*\/data\///')" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "reference.odt reference.docx $(find ${datadir} | sed -e 's/.*\/data\///')" -- ${cur}) )
|
||||||
return 0
|
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)
|
--highlight-style)
|
||||||
COMPREPLY=( $(compgen -W "pygments tango espresso zenburn kate monochrome haddock" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${highlight_styles}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -52,7 +67,8 @@ _pandoc()
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=( $(compgen -f ${cur}) )
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $(compgen -X '' -f ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -478,7 +478,7 @@ options =
|
||||||
case safeRead ("Wrap" ++ uppercaseFirstLetter arg) of
|
case safeRead ("Wrap" ++ uppercaseFirstLetter arg) of
|
||||||
Just o -> return opt { optWrapText = o }
|
Just o -> return opt { optWrapText = o }
|
||||||
Nothing -> err 77 "--wrap must be auto, none, or preserve")
|
Nothing -> err 77 "--wrap must be auto, none, or preserve")
|
||||||
"[auto|none|preserve]")
|
"auto|none|preserve")
|
||||||
"" -- "Option for wrapping text in output"
|
"" -- "Option for wrapping text in output"
|
||||||
|
|
||||||
, Option "" ["columns"]
|
, Option "" ["columns"]
|
||||||
|
@ -609,7 +609,7 @@ options =
|
||||||
Just tlDiv -> return opt { optTopLevelDivision = tlDiv }
|
Just tlDiv -> return opt { optTopLevelDivision = tlDiv }
|
||||||
_ -> err 76 ("Top-level division must be " ++
|
_ -> err 76 ("Top-level division must be " ++
|
||||||
"section, chapter, part, or default"))
|
"section, chapter, part, or default"))
|
||||||
"[section|chapter|part]")
|
"section|chapter|part")
|
||||||
"" -- "Use top-level division type in LaTeX, ConTeXt, DocBook"
|
"" -- "Use top-level division type in LaTeX, ConTeXt, DocBook"
|
||||||
|
|
||||||
, Option "N" ["number-sections"]
|
, Option "N" ["number-sections"]
|
||||||
|
@ -912,6 +912,7 @@ options =
|
||||||
UTF8.hPutStrLn stdout $ printf tpl allopts
|
UTF8.hPutStrLn stdout $ printf tpl allopts
|
||||||
(unwords (map fst readers))
|
(unwords (map fst readers))
|
||||||
(unwords (map fst writers))
|
(unwords (map fst writers))
|
||||||
|
(unwords $ map fst highlightingStyles)
|
||||||
ddir
|
ddir
|
||||||
exitSuccess ))
|
exitSuccess ))
|
||||||
"" -- "Print bash completion script"
|
"" -- "Print bash completion script"
|
||||||
|
|
Loading…
Reference in a new issue