Table of Contents

Class SubcommandMetadata

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

Metadata about a subcommand, extracted at compile time or via reflection.

public sealed class SubcommandMetadata
Inheritance
object
SubcommandMetadata

Constructors

SubcommandMetadata(Type)

Initializes a new instance of the SubcommandMetadata class.

public SubcommandMetadata(Type subcommandType)

Parameters

subcommandType Type

The type of the subcommand.

Properties

CommandName

The command name (if specified, otherwise derived from type name).

public string? CommandName { get; init; }

Property Value

string

MetadataProviderFactory

Factory to get the metadata provider for the subcommand type. This avoids reflection when the subcommand also has generated metadata.

public Func<ICommandMetadataProvider>? MetadataProviderFactory { get; init; }

Property Value

Func<ICommandMetadataProvider>

SubcommandType

The type of the subcommand.

public Type SubcommandType { get; }

Property Value

Type