@@ -73,18 +73,18 @@ var Base = module.exports = function Base(args, options) {
73
73
74
74
this . option ( 'help' , {
75
75
alias : 'h' ,
76
- desc : 'Print the generator\'s options and usage'
76
+ description : 'Print the generator\'s options and usage'
77
77
} ) ;
78
78
79
79
this . option ( 'skip-cache' , {
80
80
type : Boolean ,
81
- desc : 'Do not remember prompt answers' ,
81
+ description : 'Do not remember prompt answers' ,
82
82
default : false
83
83
} ) ;
84
84
85
85
this . option ( 'skip-install' , {
86
86
type : Boolean ,
87
- desc : 'Do not automatically install dependencies' ,
87
+ description : 'Do not automatically install dependencies' ,
88
88
default : false
89
89
} ) ;
90
90
@@ -179,7 +179,7 @@ Base.prototype.prompt = function (questions) {
179
179
*
180
180
* ### Options:
181
181
*
182
- * - `desc ` Description for the option
182
+ * - `description ` Description for the option
183
183
* - `type` Either Boolean, String or Number
184
184
* - `alias` Option name alias (example `-h` and --help`)
185
185
* - `default` Default value
@@ -191,11 +191,15 @@ Base.prototype.prompt = function (questions) {
191
191
192
192
Base . prototype . option = function option ( name , config ) {
193
193
config = config || { } ;
194
+
195
+ // alias default to defaults for backward compatibility.
196
+ config . default = config . default != null ? config . default : config . defaults ;
197
+ config . description = config . description || config . desc ;
198
+
194
199
_ . defaults ( config , {
195
200
name : name ,
196
- desc : 'Description for ' + name ,
201
+ description : 'Description for ' + name ,
197
202
type : Boolean ,
198
- default : config . defaults ,
199
203
hide : false
200
204
} ) ;
201
205
@@ -219,7 +223,7 @@ Base.prototype.option = function option(name, config) {
219
223
*
220
224
* ### Options:
221
225
*
222
- * - `desc ` Description for the argument
226
+ * - `description ` Description for the argument
223
227
* - `required` Boolean whether it is required
224
228
* - `optional` Boolean whether it is optional
225
229
* - `type` String, Number, Array, or Object
@@ -233,7 +237,8 @@ Base.prototype.argument = function argument(name, config) {
233
237
config = config || { } ;
234
238
235
239
// alias default to defaults for backward compatibility.
236
- config . default = config . default || config . defaults ;
240
+ config . default = config . default != null ? config . default : config . defaults ;
241
+ config . description = config . description || config . desc ;
237
242
238
243
_ . defaults ( config , {
239
244
name : name ,
0 commit comments