Class CmdParser
Parses command-line input.
Namespace: Evergine.Common.Helpers
Assembly: Evergine.Common.dll
Syntax
public class CmdParser
Constructors
CmdParser()
Initializes a new instance of the CmdParser class.
Declaration
public CmdParser()
Properties
ErrorMessage
Gets the error text message.
Declaration
public string ErrorMessage { get; }
Property Value
Type | Description |
---|---|
string |
Methods
AddOption(Option)
Adds a new option to the parser.
Declaration
public CmdParser AddOption(CmdParser.Option newOption)
Parameters
Type | Name | Description |
---|---|---|
CmdParser.Option | newOption | Option to add. |
Returns
Type | Description |
---|---|
CmdParser | This instance object. |
Parse(string[])
Parses the arguments inside the command line.
Declaration
public bool Parse(string[] args)
Parameters
Type | Name | Description |
---|---|---|
string[] | args | The argument array. |
Returns
Type | Description |
---|---|
bool | True if the parsing was successful. |
ShowHelp(string)
Shows the documentation on the console.
Declaration
public bool ShowHelp(string msg)
Parameters
Type | Name | Description |
---|---|---|
string | msg | The error message. |
Returns
Type | Description |
---|---|
bool | True if everything is ok. |