Table of Contents

CliOptionAttribute.Name Property

Definition

Namespace
DotMake.CommandLine
Assembly
DotMake.CommandLine.dll

Gets or sets the name of the option that will be used on the command line to specify the option.

When manually setting a name, if you don't specify a prefix, it will be prefixed automatically according to NamePrefixConvention (e.g. --option, -option or /option) unless it's set to None.

If not set (or is empty/whitespace), the name of the property that this attribute is applied to, will be used to generate option name automatically: These suffixes will be stripped from the property name: RootCliCommandOption, RootCommandOption, SubCliCommandOption, SubCommandOption, CliCommandOption, CommandOption, CliOption, Option. Then the name will be converted to kebab-case and will be prefixed with POSIX convention two hyphens (--), for example:

  • If property name is Input or InputOption or InputCliOption -> option name will be --input
  • If property name is SearchPath or SearchPathOption or SearchPathCliOption -> option name will be --search-path

Default conventions can be changed via parent command's NameCasingConvention and NamePrefixConvention properties.

public string Name { get; set; }

Property Value

string