Table of Contents

CliCommandAttribute.Name Property

Definition

Namespace
DotMake.CommandLine
Assembly
DotMake.CommandLine.dll

Gets or sets the name of the command that will be used on the command line to specify the command. This will be displayed in usage help of the command line application.

If not set (or is empty/whitespace), the name of the class that this attribute is applied to, will be used to generate command name automatically: These suffixes will be stripped from the class name: RootCliCommand, RootCommand, SubCliCommand, SubCommand, CliCommand, Command, Cli. Then the name will be converted to kebab-case, for example:

  • If class name is Buildor BuildCommandor BuildRootCliCommand-> command name will be build
  • If class name is BuildTextor BuildTextCommandor BuildTextSubCliCommand-> command name will be build-text

Default convention can be changed via command's NameCasingConventionproperty.

public string Name { get; set; }

Property Value

string