InitOption
An option the "atscm init" command handles. TODO: Support function values for name, message, default, choices...
Test:
Static Member Summary
Static Public Members | ||
public static get |
The default inquirer~PromptType to use. |
Constructor Summary
Public Constructor | ||
public |
constructor(messageOrOptions: string | Object, defaultOrUndefined: string | number) Creates a new option based either on a message and (optionally) a default value or some options. |
Member Summary
Public Members | ||
public |
The choices available. |
|
public |
The default value to use. |
|
public |
The option's message. A '?' sign is added automatically. |
|
public |
The option's inquirer~PromptType. Defaults to 'input'. |
|
public |
Validates the user input for this option. |
|
public |
A function or boolean that indicates weather or not to prompt this option. |
Static Public Members
public static get DefaultType: inquirer~PromptType: string source
The default inquirer~PromptType to use. Equals 'input'.
Public Constructors
public constructor(messageOrOptions: string | Object, defaultOrUndefined: string | number) source
Creates a new option based either on a message and (optionally) a default value or some options.
Params:
Name | Type | Attribute | Description |
messageOrOptions | string | Object | The message or options to use. |
|
messageOrOptions.type | inquirer~PromptType |
|
The option's type. |
messageOrOptions.message | string | The option's message. Required if |
|
messageOrOptions.default | string | number |
|
The options's default value. |
messageOrOptions.validate | inquirer~Validator |
|
A function that validates user input. |
messageOrOptions.choices | string[] | number[] |
|
The options's choices. Applies to to list types only. |
messageOrOptions.when | boolean | function(answers: Object): boolean |
|
Weather or not to prompt this option. |
defaultOrUndefined | string | number |
|
The default value to use. |