Skip to content

Commit

Permalink
Print generics correctly. Simple implementation which may break when …
Browse files Browse the repository at this point in the history
…unsupported generic types are used, but those already had potential problems
  • Loading branch information
Nick-Lucas committed Feb 4, 2017
1 parent dda0f17 commit c59caeb
Showing 1 changed file with 5 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

0 comments on commit c59caeb

Please sign in to comment.