-
Notifications
You must be signed in to change notification settings - Fork 16
/
git-journal.zsh
235 lines (227 loc) · 7.79 KB
/
git-journal.zsh
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#compdef git-journal
_git-journal() {
typeset -A opt_args
local ret=1
local context curcontext="$curcontext" state line
_arguments -s -S -C \
"-p+[Sets a custom working path.]" \
"--path+[Sets a custom working path.]" \
"-n+[The number of tags until the parser stops when a single revision is given.]" \
"--tags-count+[The number of tags until the parser stops when a single revision is given.]" \
"-e+[A pattern to exclude git tags from the processing.]" \
"-t+[Use a custom output template.]" \
"--template+[Use a custom output template.]" \
"-o+[The output file for the changelog.]" \
"--output+[The output file for the changelog.]" \
"-a[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
"--all[Do not stop parsing at the first tag when a single revision is given. Overwrites '-n/--tags-count'.]" \
"-g[Generate a fresh output template from a commit range.]" \
"--generate[Generate a fresh output template from a commit range.]" \
"-s[Print only the shortlog (summary) form.]" \
"--short[Print only the shortlog (summary) form.]" \
"-u[Skip entries without any relation to a git TAG.]" \
"--skip-unreleased[Skip entries without any relation to a git TAG.]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_commands" \
"*:: :->git-journal" \
&& ret=0
case $state in
(git-journal)
curcontext="${curcontext%:*:*}:git-journal-command-$words[1]:"
case $line[1] in
(p)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_prepare_commands" \
&& ret=0
;;
(prepare)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_prepare_commands" \
&& ret=0
;;
(s)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
(setup)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
(v)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_verify_commands" \
&& ret=0
;;
(verify)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"1:: :_git-journal_verify_commands" \
&& ret=0
;;
(help)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
(help)
_arguments -s -S -C \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
"-h[Prints help information]" \
"--help[Prints help information]" \
"-V[Prints version information]" \
"--version[Prints version information]" \
&& ret=0
;;
esac
;;
esac
}
(( $+functions[_git-journal_commands] )) ||
_git-journal_commands() {
local commands; commands=(
"prepare:Prepare a commit message before the user can edit it." \
"p:Prepare a commit message before the user can edit it." \
"setup:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
"s:Creates all necessary git hooks and an initial configuration file. Shell completions for bash and fish will be available inside the current working directory." \
"verify:Verify the specified commit message." \
"v:Verify the specified commit message." \
"help:Prints this message or the help of the given subcommand(s)" \
"help:Prints this message or the help of the given subcommand(s)" \
"REVISION_RANGE:Specifies the revision range to be processed. If a single revision is specified, the output will stop at the first following git TAG." \
)
_describe -t commands 'git-journal commands' commands "$@"
}
(( $+functions[_git-journal_help_commands] )) ||
_git-journal_help_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal help commands' commands "$@"
}
(( $+functions[_git-journal_p_commands] )) ||
_git-journal_p_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'git-journal p commands' commands "$@"
}
(( $+functions[_p_commands] )) ||
_p_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'p commands' commands "$@"
}
(( $+functions[_git-journal_prepare_commands] )) ||
_git-journal_prepare_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
"TYPE:The type of the commit. For example "message"." \
)
_describe -t commands 'git-journal prepare commands' commands "$@"
}
(( $+functions[_git-journal_s_commands] )) ||
_git-journal_s_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal s commands' commands "$@"
}
(( $+functions[_s_commands] )) ||
_s_commands() {
local commands; commands=(
)
_describe -t commands 's commands' commands "$@"
}
(( $+functions[_git-journal_setup_commands] )) ||
_git-journal_setup_commands() {
local commands; commands=(
)
_describe -t commands 'git-journal setup commands' commands "$@"
}
(( $+functions[_git-journal_v_commands] )) ||
_git-journal_v_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'git-journal v commands' commands "$@"
}
(( $+functions[_v_commands] )) ||
_v_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'v commands' commands "$@"
}
(( $+functions[_git-journal_verify_commands] )) ||
_git-journal_verify_commands() {
local commands; commands=(
"MESSAGE:The path to the commit message which should be prepared." \
)
_describe -t commands 'git-journal verify commands' commands "$@"
}
_git-journal "$@"