Interactive

Provides helpers to prompt users.

Namespace:
Inetdev.CLI
Type:
Class
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
No
Inherits from:
System.Object

Constructors

Interactive

Default constructor

Signature:
public Void Interactive()

Methods

CollectPassword

Collect password data without echoing to the console.

Signature:
protected String CollectPassword()

Prompt

Promps the user for text.

Signature:
protected String Prompt(prompt, defaultValue)
Parameters
Name Type Summary
prompt String Prompt message.
defaultValue String Default value if nothing is entered.

PromptInt

Prompts the user for an integer value.

Signature:
public Int32 PromptInt(defaultValue, prompt, invalidMessage, minValue, maxValue)
Parameters
Name Type Summary
defaultValue Nullable<Int32> Default value if nothing is entered.
prompt String Prompt message.
invalidMessage String Invalid message.
minValue Int32 Minimum allowed value.
maxValue Int32 Maximim allowed value.

PromptOption

Prompt the user for an option.

Signature:
public String PromptOption(defaultValue, options, prompt, invalidMessage, allowEmpty)
Parameters
Name Type Summary
defaultValue Char Default value if nothing is entered.
options Char[] Allowed options.
prompt String Prompt message.
invalidMessage String Invalid message.
allowEmpty Boolean Whether an empty result is valid.

PromptPassword

Prompt the user for a password.

Signature:
public String PromptPassword(defaultValue, prompt, promptConfirm, invalidMessage, invalidConfirmMessage, allowEmpty)
Parameters
Name Type Summary
defaultValue String Default value if nothing is entered.
prompt String Prompt message.
promptConfirm String Confirmation prompt message.
invalidMessage String Invalid message.
invalidConfirmMessage String Invalid message for confirmation.
allowEmpty Boolean Whether an empty result is valid.

PromptString

Prompts the user for a text.

Signature:
public String PromptString(defaultValue, prompt, invalidMessage, allowEmpty)
Parameters
Name Type Summary
defaultValue String Default value if nothing is entered.
prompt String Prompt message.
invalidMessage String Invalid message.
allowEmpty Boolean Whether an empty result is valid.

WriteInvalidMessage

Writes the message to the console.

Signature:
protected Void WriteInvalidMessage(message)
Parameters
Name Type Summary
message String Message to write.