Skip to content

Commit

Permalink
Merge branch 'bug/fix-lists-in-help-generator'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Lucas committed Feb 4, 2017
2 parents a74cd43 + c59caeb commit 19a15f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/EntryPoint/Arguments/CliArgumentsHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static string GenerateBreakdown(List<Option> options, List<Operand> operands) {
string type = GetOperandTypeString(operand);
breakdown.AppendLine($" [Operand {position}{type}]");
breakdown.AppendLine($" {operand.Help.Detail}");
breakdown.AppendLine();
}

return breakdown.ToString();
Expand All @@ -96,6 +97,10 @@ static string GetTypeSummary(Type type) {
.GetNames(type)
.Select(s => s);
return string.Join("|", names);
} else if (type.GetTypeInfo().IsGenericType) {
string genericType = type.Name.Remove(type.Name.IndexOf("`"));
string genericParam = type.GenericTypeArguments.Single().Name;
return $"{genericType}<{genericParam}>";
} else {
return type.Name.ToUpper();
}
Expand Down
4 changes: 4 additions & 0 deletions test/Example/CommandLine/PrimaryCliArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ public PrimaryCliArguments() : base("Example Project") { }
[Option(ShortName: 'c')]
[Help("A test option. Does nothing")]
public bool Option3 { get; set; }

[Operand(Position: 2)]
[Help("A test list, used when checking help-generator output")]
public List<int> ListOperands { get; set; }
}
}

0 comments on commit 19a15f3

Please sign in to comment.