diff --git a/share/completions/pandoc.fish b/share/completions/pandoc.fish index 1d45753f2..cb2927276 100644 --- a/share/completions/pandoc.fish +++ b/share/completions/pandoc.fish @@ -98,9 +98,9 @@ complete -c pandoc -r -f -l bibliography -a "(__fish_complete_suffix 'ria')" complete -c pandoc -r -f -l lua-filter -a "(__fish_complete_suffix 'lua')" # options that take files in DATADIR -complete -c pandoc -r -s F -l filter -a "(find $datadir/filters/** | sed -e 's|$datadir/filters/||')" -complete -c pandoc -r -l template -a "(find $datadir/templates/** | sed -e 's|$datadir/templates/||')" -complete -c pandoc -r -f -l lua-filter -a "(find $datadir/** | egrep '.lua\$' | sed -e 's|$datadir/||')" +complete -c pandoc -r -s F -l filter -a "(find $datadir/filters/** | string replace -- '$datadir/filters/' '')" +complete -c pandoc -r -l template -a "(find $datadir/templates/** | string replace -- '$datadir/templates/' '')" +complete -c pandoc -r -f -l lua-filter -a "(find $datadir/** | string match -r '.lua\$' | string replace -- '$datadir/' '')" # options that require arguments which cannot be autocompleted complete -c pandoc -x -l indented-code-classes