Edit

Share via


Directive Class

Definition

The purpose of directives is to provide cross-cutting functionality that can apply across command-line apps. 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.
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

Constructors

Directive(String)

Initializes a new instance of the Directive class.

Properties

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

GetCompletions(CompletionContext)

Gets completions for the symbol.

ToString()

Returns a string that represents the current object.

(Inherited from Symbol)

Applies to