Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRage.Game.ModAPI.Ingame.Utilities.MyCommandLine

Malware edited this page Dec 13, 2025 · 43 revisions

DEPRECATION NOTICE

This API documentation is out of date and no longer maintained.

Please visit the new documentation at: https://malforge.github.io/spaceengineers/pbapi

IndexNamespace Index

MyCommandLine Class

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.

Namespace: VRage.Game.ModAPI.Ingame.Utilities
Assembly: VRage.Game.dll

Properties

int ArgumentCount { get; }

Returns the number of non-switch arguments

ItemCollection Items { get; }

Contains all items, both arguments and switches

SwitchCollection Switches { get; }

Contains a list of all detected switches

Constructors

MyCommandLine()

Methods

string Argument(int index)

Returns the argument at the given index. Switches are not counted.

void Clear()

Clears all arguments

bool Switch(string name)

Determines whether the given switch is set. Switches are specified without their prefixed hyphen.

string Switch(string name, int relativeArgument)

Gets an argument of a switch. For example, usingSwitch("key", 0)on the command linesomeOtherArgument -key valuewill returnvalue.

bool TryParse(string argument)

Attempts to parse the given string as a command line

Clone this wiki locally