Fixe the timeout issue with BlackBerry Storm
[barry/progweb.git] / zsh / _bjavaloader
blobf96331c7189e6978a5621c53cdd6ac6fe3021667
1 #compdef bjavaloader
3 local _bjavaloader_options
5 local ret=1
6 local state line cmds
9 _bjavaloader_options=(
10         '-f[Force erase, if module is in use]' \
11         '-h[Show the most relevant command line options]' \
12         '-s[List sibling in module list]' \
13         '-p[PIN of device to talk with]' \
14         '-P[PIN of device to talk with (optional)]' \
15         '-v[Dump protocol data during operation]' \
16         '1: :->cmds' \
17         '*: :->args'
21 _arguments -C -s "$_bjavaloader_options[@]" && ret=0
23 case $state in
24         cmds)
25                 cmds=(dir load erase screenshot settime)
26                 _describe -t commands 'bjavaloader command' cmds && ret=0
27         ;;
29         args)
30                 case $line[1] in
31                         load)
32                                 _arguments -C -A '-*' -s \
33                                         - recur \
34                                         '*:directory:_path_files -/' \
35                                         - nonrecur \
36                                         '*:COD files:_path_files -g "*.cod(-.)"' && ret=0
37                         ;;
39                         screenshot)
40                                 _arguments -C -A '-*' -s \
41                                         - recur \
42                                         '*:directory:_path_files -/' \
43                                         - nonrecur \
44                                         '*:BMP files:_path_files -g "*.bmp(-.)"' && ret=0
45                         ;;
47                         settime)
48                                 _message 'time format [yyyy-mm-dd HH:MM:SS]' && ret=0
49                         ;;
51                         (*|dir))
52                                 _message 'no more arguments' && ret=0
53                         ;;
54                 esac
55         ;;
56 esac
58 return ret