-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path_bb
84 lines (66 loc) · 1.53 KB
/
_bb
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
#compdef bb
# command -bar Update !cp _bb ~/.zsh/_bb
_bb_announcements_complete() {
return
}
_bb_balance_complete()
{
_arguments \
'(- :)-h[display the help]' \
'-v[be verbose]' \
'-u[show URos/FLEX]' \
'-d[show declining]'
}
_bb_bill_complete() {
_arguments \
'(- :)-h[display the help]' \
'--pdf[Use a PDF file]: :_files'
}
_bb_courses_complete() {
return
}
_bb_grades_complete() {
_arguments \
'(- :)-h[display the help]'
}
_bb_materials_complete() {
_arguments \
'(- :)-h[display the help]' \
'-v[be verbose]'
}
_bb_submit_complete() {
_arguments \
'(- :)-h[display the help]' \
'-v[be verbose]' \
'-f[submit a file]: :_files' \
'-t[specify submission text]: :( )' \
'-c[specify comments]: :( )'
}
_bb_pay_complete() {
_arguments \
'(- :)-h[display the help]' \
'-v[be verbose]' \
'-m[specify payment method]'
}
_bb_payments_complete() {
return
}
_bb_help_complete() {
_arguments \
': :(submit balance bill pay grades material announcements)'
}
_bb()
{
local context state state_descr line cmd
typeset -A opt_args
_arguments -R \
'(- :)-h[display the help]' \
': :(announcements balance bill courses grades materials submit pay payments help)' \
'*:: :->command' \
&& return
[[ $state = command ]] || return 1
cmd=${words[1]}
which _bb_${cmd}_complete &>/dev/null || return 1
_bb_${cmd}_complete
}
_bb