Interface ICommandMetadataProvider
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
Provides metadata about a command model type. Implemented by both reflection-based and source-generated providers.
public interface ICommandMetadataProvider
Properties
Arguments
Gets metadata for all arguments defined on the model.
IReadOnlyList<ArgumentMetadata> Arguments { get; }
Property Value
CommandInfo
Gets metadata about the command itself (name, description, etc.).
CommandMetadata? CommandInfo { get; }
Property Value
ExecuteHandler
Gets the execute handler if one is defined (OnExecute/OnExecuteAsync).
IExecuteHandler? ExecuteHandler { get; }
Property Value
HelpOption
Gets help option metadata if defined.
HelpOptionMetadata? HelpOption { get; }
Property Value
ModelType
Gets the model type this provider handles.
Type ModelType { get; }
Property Value
Options
Gets metadata for all options defined on the model.
IReadOnlyList<OptionMetadata> Options { get; }
Property Value
SpecialProperties
Gets property accessors for setting Parent, RemainingArgs, Subcommand.
SpecialPropertiesMetadata? SpecialProperties { get; }
Property Value
Subcommands
Gets metadata for subcommand types.
IReadOnlyList<SubcommandMetadata> Subcommands { get; }
Property Value
ValidateHandler
Gets the validate handler if one is defined (OnValidate).
IValidateHandler? ValidateHandler { get; }
Property Value
ValidationErrorHandler
Gets the validation error handler if one is defined (OnValidationError).
IValidationErrorHandler? ValidationErrorHandler { get; }
Property Value
VersionOption
Gets version option metadata if defined.
VersionOptionMetadata? VersionOption { get; }
Property Value
Methods
GetModelFactory(IServiceProvider?)
Creates a model factory for the type.
IModelFactory GetModelFactory(IServiceProvider? services)
Parameters
servicesIServiceProviderOptional service provider for dependency injection.
Returns
- IModelFactory
A factory that can create model instances.