forked from babarot/zgencomp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.json
executable file
·194 lines (172 loc) · 6.52 KB
/
sample.json
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
{
// Command name you want to complement
"command" : "mycmd",
// Property for the command
"properties" : {
"author" : "John Doe",
"license" : "MIT",
// For the help and version, it is treated as
// one of the attribute information instead of
// the normal options (special option).
// The reason for this is because in accordance
// with the GNU command-line interfaces style.
// cf https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
"help" : {
// Although not talking limited only this 'help',
// if the "option" does not have the one or more elements,
// that option is not enabled.
// ( Example )
// "option" : [] => Not available
"option" : [
"-h",
"--help"
],
// Description of commands that are displayed during completion
// ( Example )
// -h, --help something description
"description" : "show this help and exit"
},
// Almost same as "help"
"version" : {
"option" : [
"-V",
"--version"
],
"description" : "show version"
}
},
// Normal option {{{1
// The normal option consists of flag options that always take arguments
// and switch options that take no arguments.
// (However, the flag option might be omitted arguments.
// This does not mean that no arguments.)
"options" : {
// Switch options {{{2
"switch" : [
{
"option" : [
"-p",
"--plain"
],
"description" : "show with plain text",
// The exclusive control of the option
// Normally, there is no need to specify the same options at a time
// eg. `ls -l -l file`
// In addition, optional command has the combination is meaningless
// by specifying the same time.
// For example, ssh -4, -6 option is specified
// to explicitly connect to each IPv4, IPv6
// It is meaningless to specify both this.
// This exclusion item will remove the option that has already
// appeared on the command line and the meaningless option
// from the following completion.
"exclusion" : [
]
},
// empty
{
"option" : [
],
"description" : ""
}
],
// }}}
// Flag options {{{2
"flag" : [
{
"option" : [
"-A",
"--after-context"
],
"description" : "Print num lines of trailing context after each match",
"exclusion" : [
"-p"
],
// Defin arguments that flag option to take.
"argument" : {
// Complement word is grouped when complement
// Set the group name here
// If blank, do not set the group name.
"group" : "",
// Define the kind of argument that flag option takes
// Select from the following
// "file", "dir", "func"
//
// If you want to specify complement words directly, try to below.
// "type" : [
// "init",
// "add",
// "commit"
// ],
//
// Take as follows if you want to add a description of the complement word.
// "type" : {
// "init" : "Create an empty Git repository or reinitialize an existing one",
// "add" : "Add file contents to the index",
// "commit" : "Record changes to the repository"
// },
"type" : "func",
// Define a way of taking the argument of flag options
// Flag style should be applicable to any of the following
// Flag style is required to apply to any of
// "standard", "touch", "touchable", "equal" or "equalable"
// Example1$B!'(B "touch" : ["-A"]
// Example2$B!'(B "equal" : ["-A", "--after-context"]
// Options that are not affiliated is treated as "standard".
// If the option is belong to more than one style, first style is adapted.
// Example3: "touch" : ["-A"], "equal" : ["-A"] => "touch"
"style" : {
// standard is
// -opt VAL
"standard" : ["-A"],
// touch is
// -optVAL
"touch" : [],
// touchable is
// -optVAL or -opt VAL
"touchable" : [],
// equal is
// -opt=VAL
"equal" : ["--after-context"],
// equalable is
// -opt=VAL or -opt VAL
"equalable" : []
}
}
},
// empty
{
"option" : [
],
"description" : "",
"exclusion" : [
],
"argument": {
"group" : "",
"type" : "",
"style" : {
"standard" : [],
"touch" : [],
"touchable" : [],
"equal" : [],
"equalable" : []
}
}
}
]
// }}}
},
// }}}
// Arguments of the command {{{1
"arguments" : {
// Whether the command requires arguments
// `mkdir` => true
// `cd` => false
"always" : true,
"after_arg" : false,
// Almost same as type od flag option
"type" : "func"
}
// }}}
}
// vim: fdm=marker