Assembly: VRage.Game.dll

public class MyCommandLine

A utility class to parse arguments from a command line string. Switches are defined with hyphen (-switch). Quotes can be placed around an argument to parse verbatim, but inner quotes will be copied verbatim. For example, "one"two" will result in the string one"two.

Properties

Member Description
ArgumentCount Returns the number of non-switch arguments
Items Contains all items, both arguments and switches
Switches Contains a list of all detected switches

Constructors

Member Description
MyCommandLine()

Methods

Member Description
Argument(int) Returns the argument at the given index. Switches are not counted.
Clear() Clears all arguments
Switch(string) Determines whether the given switch is set. Switches are specified without their prefixed hyphen.
Switch(string, int) Gets an argument of a switch. For example, usingSwitch("key", 0)on the command linesomeOtherArgument -key valuewill returnvalue.
TryParse(string) Attempts to parse the given string as a command line