Provides base properties for creating an attribute, used to define rules for command line parsing.
상속: System.Attribute
예제 #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 "";
 }
예제 #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),
 };