@@ -84,18 +84,56 @@ export interface Option {
84
84
*/
85
85
description : string ;
86
86
87
+ /**
88
+ * The type of option value. If multiple types exist, this type will be the first one, and the
89
+ * types array will contain all types accepted.
90
+ */
87
91
type : OptionType | 'suboption' ;
92
+
93
+ /**
94
+ * {@see type }
95
+ */
88
96
types ?: OptionType [ ] ;
89
97
98
+ /**
99
+ * Aliases supported by this option.
100
+ */
90
101
aliases : string [ ] ;
102
+
103
+ /**
104
+ * Whether this option is required or not.
105
+ */
91
106
required ?: boolean ;
107
+
108
+ /**
109
+ * Format field of this option.
110
+ */
92
111
format ?: string ;
112
+
113
+ /**
114
+ * Whether this option should be hidden from the help output. It will still show up in JSON help.
115
+ */
93
116
hidden ?: boolean ;
117
+
118
+ /**
119
+ * Default value of this option.
120
+ */
94
121
default ?: string | number | boolean ;
122
+
123
+ /**
124
+ * If this option can be used as an argument, the position of the argument. Otherwise omitted.
125
+ */
95
126
positional ?: number ;
127
+
128
+ /**
129
+ * Smart default object.
130
+ */
96
131
$default ?: OptionSmartDefault ;
97
132
}
98
133
134
+ /**
135
+ * Scope of the command.
136
+ */
99
137
export enum CommandScope {
100
138
InProject = 'in' ,
101
139
OutProject = 'out' ,
@@ -116,7 +154,14 @@ export enum CommandType {
116
154
* A description of a command, its metadata.
117
155
*/
118
156
export interface CommandDescription {
157
+ /**
158
+ * Name of the command.
159
+ */
119
160
name : string ;
161
+
162
+ /**
163
+ * Short description (1-2 lines) of this command.
164
+ */
120
165
description : string ;
121
166
122
167
/**
@@ -129,15 +174,40 @@ export interface CommandDescription {
129
174
*/
130
175
usageNotes ?: string ;
131
176
177
+ /**
178
+ * List of all supported options.
179
+ */
132
180
options : Option [ ] ;
133
181
182
+ /**
183
+ * Aliases supported for this command.
184
+ */
134
185
aliases : string [ ] ;
186
+
187
+ /**
188
+ * Scope of the command, whether it can be executed in a project, outside of a project or
189
+ * anywhere.
190
+ */
135
191
scope : CommandScope ;
192
+
193
+ /**
194
+ * Type of command.
195
+ */
136
196
type : CommandType ;
137
197
198
+ /**
199
+ * Whether this command should be hidden from a list of all commands.
200
+ */
201
+ hidden : boolean ;
202
+
203
+ /**
204
+ * The constructor of the command, which should be extending the abstract Command<> class.
205
+ */
138
206
impl : CommandConstructor ;
139
207
140
- hidden : boolean ;
208
+ /**
209
+ * Suboptions.
210
+ */
141
211
suboptions ?: {
142
212
[ name : string ] : Option [ ] ;
143
213
} ;
0 commit comments