Fix possible resource leak
[claws.git] / tools / bash_completion / claws-mail
1 # claws-mail(1) completion
2 _claws-mail()
3 {
4         local cur prev words cword
5         _init_completion || return
6
7         case $prev in
8         --help|-h|--version|-v|--version-full|-V)
9                 return
10                 ;;
11         --alternate-config-dir)
12                 COMPREPLY=( $( find . -maxdepth 2 -name clawsrc | sed 's,/clawsrc,,' ) )
13                 return
14                 ;;
15         --select|--status|--status-full)
16                 _filedir -d
17                 return
18                 ;;
19         --compose-from-file|--attach)
20                 _filedir
21                 return
22                 ;;
23         esac
24
25         if [[ $cur == -* ]]; then
26                 COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
27                 return
28         fi
29 } &&
30 complete -F _claws-mail claws-mail