예제 #1
0
 private static IEnumerable<string> GetPrototypes(Option option)
 {
     var parameters = _descriptionParameterRegex.Matches(option.Description).Cast<Match>().Select(x => x.Captures[0].Value).ToList();
     var prototypes = option.Prototype.TrimEnd('=').Split('|').Select(x => (x.Length == 1 ? $"-{x}" : $"--{x}"));
     if (parameters.Count > 0) prototypes = prototypes.Select(x => x + " " + StringUtils.Join(" ", parameters));
     return prototypes;
 }
예제 #2
0
 protected override void InsertItem(int index, Option item)
 {
     base.InsertItem (index, item);
 }
예제 #3
0
파일: Program.cs 프로젝트: rwakelam/Flow
 private static string GetOptionSyntax(Option option)
 {
     bool optional = option.Description.Contains("Optional");
     return string.Format("{0}/{1}{2}{3}", (optional ? "[" : ""), option.Prototype,
             (option.Prototype.EndsWith(":") ? "value" : ""), (optional ? "]" : ""));
 }