fix boolean defaults
This commit is contained in:
		| @@ -96,9 +96,13 @@ export class InteractiveOptions extends Persistent { | |||||||
|       // eslint-disable-next-line no-await-in-loop |       // eslint-disable-next-line no-await-in-loop | ||||||
|       await src.parse (this.options); |       await src.parse (this.options); | ||||||
|     } |     } | ||||||
|     for (const opt of this.options) |     for (const opt of this.options) { | ||||||
|  |       if (!opt.filled) { | ||||||
|  |         opt.value = opt.default; | ||||||
|  |         opt.filled = true; | ||||||
|  |       } | ||||||
|       this.set (opt.name, opt.value); |       this.set (opt.name, opt.value); | ||||||
|  |     } | ||||||
|     return this.to_object (); |     return this.to_object (); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -28,10 +28,12 @@ export class ArgSource extends OptionSource { | |||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
|     for (const opt of options) { |     for (const opt of options) { | ||||||
|  |       const type = opt.type_validation.persistent_type; | ||||||
|       yargs_config[opt.name] = { |       yargs_config[opt.name] = { | ||||||
|         alias:    opt.alias, |         alias:    opt.alias, | ||||||
|         default:  opt.default, |         // eslint-disable-next-line no-undefined | ||||||
|         type:     opt.type_validation.persistent_type, |         default:  type === 'boolean' ? undefined : opt.default, | ||||||
|  |         type, | ||||||
|         describe: opt.description |         describe: opt.description | ||||||
|       }; |       }; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user