21 if (
string.IsNullOrEmpty(optName)) {
throw new ArgumentNullException(nameof(optName),
"optName must not be null!"); }
23 return list.FirstOrDefault(o => o.Name?.Equals(optName, StringComparison.InvariantCulture) ==
true);
40 if (list is
null || list.Length == 0) {
return null; }
42 var sBuilder =
new StringBuilder();
44 foreach (var opt
in list) {
45 sBuilder.Append((
char)opt.Value);
46 switch (opt.ArgumentType) {
57 return sBuilder.ToString();
static ? string ToShortOptString(this Option[] list)
Creates a short opt string from an array of Option objects.
static ? Option FindOptionOrDefault(this Option[] list, char optVal)
Finds an option in the list list with the Option.Value optVal .
static ? Option FindOptionOrDefault(this Option[] list, string optName)
Finds an option with the name optName
ArgumentType
Enumeration containing the argument types possible for getopt.
Represents a single long option for getopt.