Skip to content

Commit

Permalink
fix spacing on help messages when verbs have aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjaylward committed Jun 18, 2020
1 parent da42349 commit d3ecf50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/CommandLine/Text/HelpText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ private IEnumerable<Specification> AdaptVerbsToSpecifications(IEnumerable<Type>
var optionSpecs = from verbTuple in Verb.SelectFromTypes(types)
select
OptionSpecification.NewSwitch(
verbTuple.Item1.Name,
verbTuple.Item1.Aliases.ToDelimitedString(", "),
string.Empty,
verbTuple.Item1.Name.Concat(verbTuple.Item1.Aliases).ToDelimitedString(", "),
false,
verbTuple.Item1.IsDefault ? "(Default Verb) " + verbTuple.Item1.HelpText : verbTuple.Item1.HelpText, //Default verb
string.Empty,
Expand Down
24 changes: 12 additions & 12 deletions tests/CommandLine.Tests/Unit/Issue6Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ public void Parse_option_with_aliased_verb(string args, Type expectedArgType)
{
"copy, cp, cpy (Default Verb) Copy some stuff",
"move, mv",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
})]
[InlineData("help", true, new string[]
{
"copy, cp, cpy (Default Verb) Copy some stuff",
"move, mv",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
})]
[InlineData("move --help", false, new string[]
{
Expand Down Expand Up @@ -163,16 +163,16 @@ public void Parse_help_option_for_aliased_verbs(string args, bool verbsIndex, st
[InlineData("--help", true, new string[]
{
"move, mv",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
})]
[InlineData("help", true, new string[]
{
"move, mv",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
"delete Delete stuff",
"help Display more information on a specific command.",
"version Display version information.",
})]
[InlineData("move --help", false, new string[]
{
Expand Down

0 comments on commit d3ecf50

Please sign in to comment.