update
[booh] / booh.bash-completion
1 # bash completion for booh
2
3 _booh-backend()
4 {
5         local cur prev
6
7         COMPREPLY=()
8         cur=${COMP_WORDS[COMP_CWORD]}
9         prev=${COMP_WORDS[COMP_CWORD-1]}
10
11         case $prev in
12                 -@(s|d|D|-source|-destination|-dir))
13                         _filedir -d
14                         return 0
15                         ;;
16                 -@(C|M|U|O|N|u|-config|-merge-config|-merge-config-onedir|-merge-config-subdirs|-use-config))
17                         _filedir
18                         return 0
19                         ;;
20                 -@(t|-theme))
21                         COMPREPLY=( $( command ls /usr/share/booh/themes | grep "^$cur" ) )
22                         return 0
23                         ;;
24                 -@(m|-mproc))
25                         COMPREPLY=( $( grep -c 'processor' /proc/cpuinfo | grep "^$cur" ) )
26                         return 0
27                         ;;
28         esac
29
30         if [[ "$cur" == -* ]]; then
31                 COMPREPLY=( $( compgen -W '-h --help -V --version \
32                         -s --source -d --destination -t --theme \
33                         -C --config -k --config-skel -M \
34                         --merge-config -O --merge-config-onedir \
35                         -U --merge-config-subdirs -D --dir -u \
36                         --use-config -f --force -S --sizes -T \
37                         --thumbnails-per-row -p --thumbnails-per-page \
38                         -o --optimize-for-32 -l --index-link \
39                         -n --made-with -c --comments-format \
40                         -m --mproc -g --for-gui -v \
41                         --verbose-level' -- $cur ) )
42         fi
43 }
44 complete -F _booh-backend booh-backend