/// <summary>
 /// Initializes a new instance of the <see cref="CommandLine.BaseAttribute"/> class.
 /// </summary>
 protected internal BaseAttribute()
 {
     min          = -1;
     max          = -1;
     helpText     = new Infrastructure.LocalizableAttributeProperty(nameof(HelpText));
     metaValue    = string.Empty;
     resourceType = null;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommandLine.VerbAttribute"/> class.
        /// </summary>
        /// <param name="name">The long name of the verb command.</param>
        /// <param name="isDefault">Whether the verb is the default verb.</param>
        /// <param name="aliases">aliases for this verb. i.e. "move" and "mv"</param>
        /// <exception cref="System.ArgumentException">Thrown if <paramref name="name"/> is null, empty or whitespace and <paramref name="isDefault"/> is false.</exception>
        public VerbAttribute(string name, bool isDefault = false, string[] aliases = null)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("name");
            }

            Name         = name;
            IsDefault    = isDefault;
            helpText     = new Infrastructure.LocalizableAttributeProperty(nameof(HelpText));
            resourceType = null;
            Aliases      = aliases ?? new string[0];
        }