Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Directive Class

Definition

Namespace:
System.CommandLine
Assembly:
System.CommandLine.dll
Package:
System.CommandLine v3.0.0-preview.5.26302.115
Source:
Directive.cs
Source:
Directive.cs

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.

Provides cross-cutting functionality that can apply across command-line apps.

public ref class Directive : System::CommandLine::Symbol
public class Directive : System.CommandLine.Symbol
type Directive = class
 inherit Symbol
Public Class Directive
Inherits Symbol
Inheritance
Directive
Derived

Remarks

Because directives are syntactically distinct from the app's own syntax, they can provide functionality that applies across apps.

A directive must conform to the following syntax rules: * It's a token on the command line that comes after the app's name but before any subcommands or options. * It's enclosed in square brackets. * It doesn't contain spaces.

Constructors

Name Description
Directive(String)

Initializes a new instance of the Directive class.

Properties

Name Description
Action

Gets or sets the CommandLineAction for the Directive. The handler represents the action that will be performed when the Directive is invoked.

Description

Gets or sets the description of the symbol.

(Inherited from Symbol)
Hidden

Gets or sets a value indicating whether the symbol is hidden.

(Inherited from Symbol)
Name

Gets the name of the symbol.

(Inherited from Symbol)
Parents

Gets the parent symbols.

(Inherited from Symbol)

Methods

Name Description
GetCompletions(CompletionContext)

Gets completions for the symbol.

ToString()

Returns a string that represents the current object.

(Inherited from Symbol)

Applies to


Feedback

Was this page helpful?