Provides base properties for creating an attribute, used to define rules for command line parsing.
Inheritance: System.Attribute
Esempio n. 1
0
 private static object GetOptionSyntax (BaseOptionAttribute option)
 {
     if (option is VerbOptionAttribute)
         return option.LongName;
     else if (option.ShortName != null) {
         if (option.LongName != null)
             return $"--{option.LongName}, -{option.ShortName}";
         else
             return $"-{option.ShortName}";
     }
     else if (option.LongName != null)
         return $"--{option.LongName}";
     else
         return "";
 }
Esempio n. 2
0
 private static object[] OptionNameAndHelp (BaseOptionAttribute option) => new[] {
     new Div { Margin = new Thickness(1, 0, 1, 1), Color = Yellow, MinWidth = 14 }
         .AddChildren(GetOptionSyntax(option)),
     new Div { Margin = new Thickness(1, 0, 1, 1) }
         .AddChildren(option.HelpText),
 };