Edit

Share via


DirectiveCollection Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

A collection of directives parsed from a command line.

C#
public class DirectiveCollection : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,System.Collections.Generic.IEnumerable<string>>>
Inheritance
DirectiveCollection
Implements

Remarks

A directive is specified on the command line using square brackets, containing no spaces and preceding other tokens unless they are also directives. In the following example, two directives are present, directive-one and directive-two: > myapp [directive-one] [directive-two:value] arg1 arg2 The second has a value specified as well, value. Directive values can be read by calling using TryGetValues(String, IReadOnlyList<String>).

Constructors

Methods

Contains(String)

Gets a value determining whether a directive with the specified name was parsed.

GetEnumerator()

Returns an enumerator that iterates through the collection.

TryGetValues(String, IReadOnlyList<String>)

Gets the values specified for a given directive. A return value indicates whether the specified directive name was present.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Applies to

Product Versions
System.CommandLine 2.0