This class contains all the commandline parameters. It takes a very easy approach for the formatting of commandline parameters that takes values. Basically it uses the format <flag>:<value>, eg -F:c:\path\to\file.txt where -F is the parameter name, and c:\path\to\file.txt is the value.
More...
|
| TCmdOpts () |
| Creates a new object of this class and copies all the parameters that were passed on the command line into a string list. Uses the array of strings returned by Environment.GetCommandLineArgs More...
|
|
StringCollection | GetOptKeys (string AStartingWith="") |
| return all keys of available options More...
|
|
string | GetOptValue (string AOpt) |
| Returns the value of the given option. More...
|
|
Boolean | IsFlagSet (string flag) |
| Checks if the given flag is set. Note: Flag can be defined as either a standalone flag (eg. –verbose or -v) or can be the name of a parameter (eg. -F in -Fc:\path\to\file.txt). More...
|
|
This class contains all the commandline parameters. It takes a very easy approach for the formatting of commandline parameters that takes values. Basically it uses the format <flag>:<value>, eg -F:c:\path\to\file.txt where -F is the parameter name, and c:\path\to\file.txt is the value.
if (commandLineOpts.IsFlagSet("hello")) then { Console.Writeline(commandLineOpts.GetOptValue("hello")); } /example>
◆ TCmdOpts()
Ict.Common.TCmdOpts.TCmdOpts |
( |
| ) |
|
|
inline |
Creates a new object of this class and copies all the parameters that were passed on the command line into a string list. Uses the array of strings returned by Environment.GetCommandLineArgs
- Returns
- void
◆ GetOptKeys()
StringCollection Ict.Common.TCmdOpts.GetOptKeys |
( |
string |
AStartingWith = "" | ) |
|
|
inline |
return all keys of available options
- Parameters
-
AStartingWith | only keys that start with this string |
◆ GetOptValue()
string Ict.Common.TCmdOpts.GetOptValue |
( |
string |
AOpt | ) |
|
|
inline |
Returns the value of the given option.
- Parameters
-
AOpt | The option/parameter to look for. |
- Returns
- The value of the option, or throws an exception if the value was not found
◆ IsFlagSet()
Boolean Ict.Common.TCmdOpts.IsFlagSet |
( |
string |
flag | ) |
|
|
inline |
Checks if the given flag is set. Note: Flag can be defined as either a standalone flag (eg. –verbose or -v) or can be the name of a parameter (eg. -F in -Fc:\path\to\file.txt).
- Parameters
-
flag | Flag to search for in the list of parameters. |
- Returns
- if flag was set, otherwise
The documentation for this class was generated from the following file: