// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. using System; namespace Flax.Build { /// /// The attribute to indicate the name of a command line argument and additional help description info. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Method)] public class CommandLineAttribute : Attribute { /// /// The command name. Without leading leading '-' nor '/' and trailing '=' character if a value is expected. /// public string Name; /// /// The specified fixed value for the argument. /// public string Value; /// /// The optional or required argument value hint for command line help. /// public string ValueHint; /// /// The option helper description. /// public string Description; /// /// Initializes a new instance of the class. /// /// The option name. /// The option description. public CommandLineAttribute(string name, string description) { if (name.IndexOf('-') != -1) throw new Exception("Command line argument cannot contain '-'."); Name = name; Description = description; } /// /// Initializes a new instance of the class. /// /// The option name. /// The option value hint for help. /// The option description. public CommandLineAttribute(string name, string valueHint, string description) { if (name.IndexOf('-') != -1) throw new Exception("Command line argument cannot contain '-'."); Name = name; ValueHint = valueHint; Description = description; } } }