4using System.Collections.Generic;
6using System.Reflection;
12 public Verb(
string name,
string helpText,
bool hidden,
bool isDefault,
string[] aliases)
14 if (
string.IsNullOrWhiteSpace(name))
16 throw new ArgumentNullException(nameof(name));
21 HelpText = helpText ??
throw new ArgumentNullException(nameof(helpText));
24 Aliases = aliases ??
new string[0];
27 public string Name {
get;
private set; }
31 public bool Hidden {
get;
private set; }
35 public string[]
Aliases {
get;
private set; }
47 public static IEnumerable<Tuple<Verb, Type>>
SelectFromTypes(IEnumerable<Type> types)
49 return from type in types
50 let attrs = type.GetTypeInfo()
53 where attrs.Length == 1
static Verb FromAttribute(VerbAttribute attribute)
Verb(string name, string helpText, bool hidden, bool isDefault, string[] aliases)
static IEnumerable< Tuple< Verb, Type > > SelectFromTypes(IEnumerable< Type > types)
Models a verb command specification.
string HelpText
Gets or sets a short description of this command line option. Usually a sentence summary.
bool Hidden
Gets or sets a value indicating whether a command line verb is visible in the help text.
string Name
Gets the verb name.
string[] Aliases
Gets or sets the aliases.
bool IsDefault
Gets whether this verb is the default verb.