NanoByte.Common  2.6.1
NanoByte.Common.Cli.CliUtils Class Reference

Provides helper methods for communication with the user via the Console. More...

Static Public Member Functions

static string ReadString ([Localizable(true)] string prompt)
 Asks the user to input a string. More...
 
static string ReadPassword ([Localizable(true)] string prompt)
 Asks the user to input a password without echoing it. More...
 

Properties

static bool StandardInputRedirected [get]
 Indicates whether the stdout stream has been redirected. More...
 
static bool StandardOutputRedirected [get]
 Indicates whether the stdout stream has been redirected. More...
 
static bool StandardErrorRedirected [get]
 Indicates whether the stdout stream has been redirected. More...
 

Detailed Description

Provides helper methods for communication with the user via the Console.

Member Function Documentation

◆ ReadPassword()

static string NanoByte.Common.Cli.CliUtils.ReadPassword ( [Localizable(true)] string  prompt)
inlinestatic

Asks the user to input a password without echoing it.

Parameters
promptThe prompt to display to the user on Console.Error.
Returns
The password the user entered; string.Empty if none.

◆ ReadString()

static string NanoByte.Common.Cli.CliUtils.ReadString ( [Localizable(true)] string  prompt)
inlinestatic

Asks the user to input a string.

Parameters
promptThe prompt to display to the user on Console.Error.
Returns
The string the user entered.
Exceptions
IOExceptionThe Console.In stream has been closed.

Property Documentation

◆ StandardErrorRedirected

bool NanoByte.Common.Cli.CliUtils.StandardErrorRedirected
staticget

Indicates whether the stdout stream has been redirected.

This only works on Windows systems. On other operating systems it always returns false.

◆ StandardInputRedirected

bool NanoByte.Common.Cli.CliUtils.StandardInputRedirected
staticget

Indicates whether the stdout stream has been redirected.

This only works on Windows systems. On other operating systems it always returns false.

◆ StandardOutputRedirected

bool NanoByte.Common.Cli.CliUtils.StandardOutputRedirected
staticget

Indicates whether the stdout stream has been redirected.

This only works on Windows systems. On other operating systems it always returns false.


The documentation for this class was generated from the following file: