gradient is now my default theme
[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                         -L --multi-languages \
39                         -o --optimize-for-32 \
40                         -r --transcode-videos \
41                         -l --index-link \
42                         -n --made-with -c --comments-format \
43                         -m --mproc -g --for-gui -v \
44                         --verbose-level' -- $cur ) )
45         fi
46 }
47
48 _booh-classifier()
49 {
50         local cur prev
51
52         COMPREPLY=()
53         cur=${COMP_WORDS[COMP_CWORD]}
54         prev=${COMP_WORDS[COMP_CWORD-1]}
55
56         if [[ "$cur" == -* ]]; then
57                 COMPREPLY=( $( compgen -W '-h --help -v --verbose-level -s --sort-by-exif-date' -- $cur ) )
58         else
59                 _filedir -d
60         fi
61 }
62
63 complete -F _booh-backend booh-backend
64 complete -F _booh-classifier booh-classifier
65