using System;
namespace Unity.Pipeline.Commands
{
///
/// Attribute to mark parameters of CLI command methods.
/// Provides parameter metadata for CLI validation and help generation.
/// Adapted from unity-tools [Parameter] attribute for Pipeline organization requirements.
///
/// Also valid on the fields/properties of an DTO, where it
/// describes a member of a nested object schema (same Name/Description/Required semantics).
///
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
public class CliArgAttribute : Attribute
{
///
/// Name of the parameter as it appears in CLI arguments.
/// Used in "unity request command_name --param_name value" syntax.
///
public string Name { get; }
///
/// Human-readable description of the parameter.
/// Used in CLI help text and parameter documentation.
///
public string Description { get; }
///
/// Whether this parameter is required for command execution.
/// Default: false (parameter is optional).
///
public bool Required { get; set; } = false;
///
/// Default value for the parameter if not provided.
/// Must be compatible with the parameter type.
///
public object DefaultValue { get; set; }
///
/// Create a new CLI parameter attribute.
///
/// Parameter name for CLI arguments
/// Human-readable description
public CliArgAttribute(string name, string description)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
Description = description ?? throw new ArgumentNullException(nameof(description));
}
}
}