Table of Contents

Class CommandMetadata

Namespace
McMaster.Extensions.CommandLineUtils.SourceGeneration
Assembly
McMaster.Extensions.CommandLineUtils.dll

Metadata about a command from the [Command] attribute.

public sealed class CommandMetadata
Inheritance
object
CommandMetadata

Properties

AdditionalNames

Additional names/aliases for the command.

public string[]? AdditionalNames { get; init; }

Property Value

string[]

AllowArgumentSeparator

Whether to allow '--' to stop parsing arguments.

public bool? AllowArgumentSeparator { get; init; }

Property Value

bool?

ClusterOptions

Whether options can be clustered behind one '-' delimiter.

public bool? ClusterOptions { get; init; }

Property Value

bool?

Description

A description of the command.

public string? Description { get; init; }

Property Value

string

ExtendedHelpText

Additional text that appears at the bottom of generated help text.

public string? ExtendedHelpText { get; init; }

Property Value

string

FullName

The full name of the command to show in help text.

public string? FullName { get; init; }

Property Value

string

Name

The primary name of the command.

public string? Name { get; init; }

Property Value

string

OptionsComparison

The way arguments and options are matched.

public StringComparison? OptionsComparison { get; init; }

Property Value

StringComparison?

ParseCulture

The culture used to convert values into types.

public CultureInfo? ParseCulture { get; init; }

Property Value

CultureInfo

ResponseFileHandling

How to handle response files.

public ResponseFileHandling? ResponseFileHandling { get; init; }

Property Value

ResponseFileHandling?

ShowInHelpText

Whether this command appears in generated help text.

public bool ShowInHelpText { get; init; }

Property Value

bool

UnrecognizedArgumentHandling

How to handle unrecognized arguments.

public UnrecognizedArgumentHandling? UnrecognizedArgumentHandling { get; init; }

Property Value

UnrecognizedArgumentHandling?

UsePagerForHelpText

Whether a Pager should be used to display help text.

public bool? UsePagerForHelpText { get; init; }

Property Value

bool?

Methods

ApplyTo(CommandLineApplication)

Applies this metadata to a command line application.

public void ApplyTo(CommandLineApplication app)

Parameters

app CommandLineApplication

The application to configure.