about summary refs log tree commit diff
path: root/Completion/Debian/Command/_bts
blob: d82606b4d6cfdd4cb8796e9df0e70534eb7e47a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#compdef bts
local expl

compset -N '[,.]' || compset -n 2

if [[ CURRENT -eq 1 ]];
then
 _wanted cmd expl 'bts command' \
 compadd show bugs close reopen retitle reassign merge unmerge tag \
         severity forwarded notforwarded help
else
 case "$words[1]" in
 	show|close|unmerge|notforwarded)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	bugs)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted package expl 'package' _deb_packages avail
	  _wanted maintainer expl 'package maintainer' compadd $DEBEMAIL
	 fi
	  _wanted sep expl 'separator' compadd -S ' ' , .
	;;
	reopen)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted submitter expl 'new submitter' compadd $DEBEMAIL
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	retitle)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted submitter expl 'new title' compadd
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	reassign)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted submitter expl 'new package' _deb_packages avail
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	merge)
	 _wanted bugnum expl 'bug number' compadd
	 if [[ CURRENT -gt 2 ]];
	 then
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	tag)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted operator expl 'operator' compadd - '+' '-' '='
	 elif [[ CURRENT -eq 4 ]];
	 then
	  _wanted tag expl 'tag' \
	  compadd patch wontfix moreinfo unreproducible fixed \
	          security potato woody sid
	 else
	  _wanted tag expl 'tag' \
	  compadd patch wontfix moreinfo unreproducible fixed \
	          security potato woody sid
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	severity)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted severity expl 'severity' \
	  compadd wishlist minor normal serious important critical grave
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	forwarded)
	 if [[ CURRENT -eq 2 ]];
	 then
	  _wanted bugnum expl 'bug number' compadd
	 elif [[ CURRENT -eq 3 ]];
	 then
	  _wanted upstream expl 'upstream email' compadd
	 else
	  _wanted sep expl 'separator' compadd -S ' ' , .
	 fi
	;;
	help)
	;&
	*) _wanted sep expl 'separator' compadd -S ' ' , .
	;;
 esac
fi