Struct OptionForm

Namespace
Pixie.Options
Assembly
Pixie.dll

Defines a form for an option.

public struct OptionForm : IEquatable<OptionForm>
Implements
Inherited Members

Constructors

OptionForm(string, bool)

Creates an option form.

public OptionForm(string name, bool isShort)

Parameters

name string

The option form's name.

isShort bool

Tells if the option form is a short form.

Properties

IsShort

Tells if this option form is a short form. Short forms may be treated differently by the option parsed.

public readonly bool IsShort { get; }

Property Value

bool

true if the option form is a short form; otherwise, false.

Name

Gets the name of this option form. This does not include any prefixes.

public readonly string Name { get; }

Property Value

string

The name of the option form.

Methods

Equals(OptionForm)

Checks if this option form equals another.

public bool Equals(OptionForm other)

Parameters

other OptionForm

The other option form.

Returns

bool

true if the option forms are equal; otherwise, false.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Long(string)

Creates a long option form with a particular name.

public static OptionForm Long(string name)

Parameters

name string

The option form's name.

Returns

OptionForm

A long option form.

Parse(string)

Parses an option form from its command-line spelling.

public static OptionForm Parse(string text)

Parameters

text string

The option form as it appears on the command line, for example -h or --help.

Returns

OptionForm

The parsed option form.

Short(string)

Creates a short option form with a particular name.

public static OptionForm Short(string name)

Parameters

name string

The option form's name.

Returns

OptionForm

A short option form.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(OptionForm, OptionForm)

Checks if two option forms are the same.

public static bool operator ==(OptionForm first, OptionForm second)

Parameters

first OptionForm

The first form to compare.

second OptionForm

The second form to compare.

Returns

bool

true if the first form equals the second; otherwise, false.

operator !=(OptionForm, OptionForm)

Checks if two option forms are different.

public static bool operator !=(OptionForm first, OptionForm second)

Parameters

first OptionForm

The first form to compare.

second OptionForm

The second form to compare.

Returns

bool

true if the first form does not equal the second; otherwise, false.