Debian Codegraph @

external/pygments.bashcomp

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!bash
2 #
3 # Bash completion support for Pygments (the 'pygmentize' command).
4 #
5
6 _pygmentize()
7 {
8 local cur prev
9
10 COMPREPLY=()
11 cur=`_get_cword`
12 prev=${COMP_WORDS[COMP_CWORD-1]}
13
14 case "$prev" in
15 -f)
16 FORMATTERS=`pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'`
17 COMPREPLY=( $( compgen -W '$FORMATTERS' -- "$cur" ) )
18 return 0
19 ;;
20 -l)
21 LEXERS=`pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'`
22 COMPREPLY=( $( compgen -W '$LEXERS' -- "$cur" ) )
23 return 0
24 ;;
25 -S)
26 STYLES=`pygmentize -L styles | grep '* ' | cut -c3- | sed s/:$//`
27 COMPREPLY=( $( compgen -W '$STYLES' -- "$cur" ) )
28 return 0
29 ;;
30 esac
31
32 if [[ "$cur" == -* ]]; then
33 COMPREPLY=( $( compgen -W '-f -l -S -L -g -O -P -F \
34 -N -H -h -V -o' -- "$cur" ) )
35 return 0
36 fi
37 }
38 complete -F _pygmentize -o default pygmentize