Class CommandSwitch
Used to indicate the different ways a command can be called on the commandline.
Inherited Members
Namespace: Petabridge.Cmd
Assembly: Petabridge.Cmd.Common.dll
Syntax
public sealed class CommandSwitch
Constructors
CommandSwitch(HashSet<string>)
Creates a new CommandSwitch based on a list of provided switches.
Declaration
public CommandSwitch(HashSet<string> switches)
Parameters
| Type | Name | Description |
|---|---|---|
| HashSet<string> | switches | The set of provided switches. |
CommandSwitch(IEnumerable<string>)
Creates a new CommandSwitch based on a list of provided switches.
Declaration
public CommandSwitch(IEnumerable<string> switches)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | switches | The set of provided switches. |
Fields
Empty
An empty CommandSwitch instance.
Declaration
public static readonly CommandSwitch Empty
Field Value
| Type | Description |
|---|---|
| CommandSwitch |
Properties
Switches
The set of switches supported by this command.
Declaration
public ICollection<string> Switches { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Methods
Contains(string)
Check to see if this CommandSwitch contains an individual switch value.
Declaration
public bool Contains(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| string | s | The switch value to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
Overlap(CommandSwitch)
Check to see if two switches overlap with each other.
Declaration
public IEnumerable<string> Overlap(CommandSwitch other)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandSwitch | other | The other CommandSwitch to check. |
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | The set of overlapping values. |