-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path_abbr
208 lines (200 loc) · 8.94 KB
/
_abbr
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
#compdef abbr
# ------------------------------------------------------------------------------
# Completion script for zsh-abbr
#
# https://github.com/olets/zsh-abbr
# v6.0.1
# Copyright (c) 2019-present Henry Bley-Vroman
#
# Licensed under the same license as zsh-abbr. See zsh-abbr's LICENSE file
#
# ------------------------------------------------------------------------------
local state line
local -i ret
ret=1
_arguments -C \
'1: :->cmds' \
'*:: :->args' && ret=0
case $state in
cmds)
_values "abbr command" \
"a[Add a new abbreviation.]" \
"add[Add a new abbreviation.]" \
"c[Erase all session abbreviations.]" \
"clear-session[Erase all session abbreviations.]" \
"e[Erase an abbreviation.]" \
"erase[Erase an abbreviation.]" \
"x[Output the ABBREVIATION's EXPANSION.]" \
"expand[Output the ABBREVIATION's EXPANSION.]" \
"export-aliases[Export abbreviations as alias commands.]" \
"g[Add a regular abbreviation, the expansion of which is prefixed with git; and add a global abbreviation, the abbreviation and expansion of which are prefixed with git.]" \
"git[Add a regular abbreviation, the expansion of which is prefixed with git; and add a global abbreviation, the abbreviation and expansion of which are prefixed with git.]" \
"help[Show the manpage.]" \
"--help[Show the manpage.]" \
"import-aliases[Add regular abbreviations for every regular alias in the session, and global abbreviations for every global alias in the session.]" \
"import-fish[Import fish abbr-syntax abbreviations.]" \
"import-git-aliases[Add regular abbreviations for every Git alias in the current session. The EXPANSION is prefixed with git\[Space\].]" \
"list[List the abbreviations with their expansions.]" \
"l[List the abbreviations only.]" \
"list-abbreviations[List the abbreviations only.]" \
"list-commands[List as commands suitable for export.]" \
"profile[Log profile information for debugging.]" \
"R[Rename an abbreviation.]" \
"rename[Rename an abbreviation.]" \
"version[Show the current version.]" \
"-v[Show the current version.]" \
"--version[Show the current version.]"
ret=0
;;
args)
case $line[1] in
a|\
add)
# [<SCOPE>] [<TYPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)] ABBREVIATION=EXPANSION
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-g)-g[expand everywhere]" \
"(--global)--global[expand everywhere]" \
"(-q)-q[silence success output]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in this session]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
e|\
erase)
# [<SCOPE>] [<TYPE>] [--dry-run] [--quiet] ABBREVIATION
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-g)-g[expand everywhere]" \
"(--global)--global[expand everywhere]" \
"(-q)-q[silence success output]" \
"(--quiet)--quiet[silence success output]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in this session]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
export-aliases|\
list|\
l|\
list-abbreviations|\
L|\
list-commands)
# [<SCOPE>] [<TYPE>]
_arguments \
"(--global)--global[expand everywhere]" \
"(-g)-g[expand everywhere]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in all sessions]" \
"(--user)--user[available in all sessions]" \
"(-U)-U[available in all sessions]"
;;
git)
# [<SCOPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)] ABBREVIATION=EXPANSION
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-q)-q[silence success output]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in all sessions]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
import-aliases)
# [<TYPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)]
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-g)-g[expand everywhere]" \
"(--global)--global[expand everywhere]" \
"(-q)-q[silence success output]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]"
;;
import-fish)
# [<SCOPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)] FILE
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-q)-q[silence success output]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in this session]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
import-git-aliases)
# [<SCOPE>] [<TYPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)] [--file <config-file>] [--prefix <ABBREVIATION prefix>]
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(--file)--file[path to a Git config file]:file:_files -/" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-g)-g[expand everywhere]" \
"(--global)--global[expand everywhere]" \
"(-q)-q[silence success output]" \
"(--prefix)--prefix[prefix added to the ABBREVIATIONs]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in all sessions]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
R|\
rename)
# [<SCOPE>] [<TYPE>] [--dry-run] [(--quiet | --quieter)] [(-f | --force)] OLD NEW
_arguments \
"(--dry-run)--dry-run[see what would result, without making any actual changes]" \
"(-f)-f[ignore warnings]" \
"(--force)--force[ignore warnings]" \
"(-g)-g[expand everywhere]" \
"(--global)--global[expand everywhere]" \
"(-q)-q[silence success output]" \
"(--qq)--qq[silence success output and warnings]" \
"(--quiet)--quiet[silence success output]" \
"(--quieter)--quieter[silence success output and warnings]" \
"(-r)-r[expand at the start of the line]" \
"(--regular)--regular[expand at the start of the line]" \
"(-S)-S[available in this session]" \
"(--session)--session[available in this session]" \
"(-U)-U[available in all sessions]" \
"(--user)--user[available in all sessions]"
ret=0
;;
esac
;;
esac
return ret
# vim: ft=zsh