Skip to content

Commit d3ecf50

Browse files
committed
fix spacing on help messages when verbs have aliases
1 parent da42349 commit d3ecf50

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/CommandLine/Text/HelpText.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ private IEnumerable<Specification> AdaptVerbsToSpecifications(IEnumerable<Type>
851851
var optionSpecs = from verbTuple in Verb.SelectFromTypes(types)
852852
select
853853
OptionSpecification.NewSwitch(
854-
verbTuple.Item1.Name,
855-
verbTuple.Item1.Aliases.ToDelimitedString(", "),
854+
string.Empty,
855+
verbTuple.Item1.Name.Concat(verbTuple.Item1.Aliases).ToDelimitedString(", "),
856856
false,
857857
verbTuple.Item1.IsDefault ? "(Default Verb) " + verbTuple.Item1.HelpText : verbTuple.Item1.HelpText, //Default verb
858858
string.Empty,

tests/CommandLine.Tests/Unit/Issue6Tests.cs

+12-12
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ public void Parse_option_with_aliased_verb(string args, Type expectedArgType)
8989
{
9090
"copy, cp, cpy (Default Verb) Copy some stuff",
9191
"move, mv",
92-
"delete Delete stuff",
93-
"help Display more information on a specific command.",
94-
"version Display version information.",
92+
"delete Delete stuff",
93+
"help Display more information on a specific command.",
94+
"version Display version information.",
9595
})]
9696
[InlineData("help", true, new string[]
9797
{
9898
"copy, cp, cpy (Default Verb) Copy some stuff",
9999
"move, mv",
100-
"delete Delete stuff",
101-
"help Display more information on a specific command.",
102-
"version Display version information.",
100+
"delete Delete stuff",
101+
"help Display more information on a specific command.",
102+
"version Display version information.",
103103
})]
104104
[InlineData("move --help", false, new string[]
105105
{
@@ -163,16 +163,16 @@ public void Parse_help_option_for_aliased_verbs(string args, bool verbsIndex, st
163163
[InlineData("--help", true, new string[]
164164
{
165165
"move, mv",
166-
"delete Delete stuff",
167-
"help Display more information on a specific command.",
168-
"version Display version information.",
166+
"delete Delete stuff",
167+
"help Display more information on a specific command.",
168+
"version Display version information.",
169169
})]
170170
[InlineData("help", true, new string[]
171171
{
172172
"move, mv",
173-
"delete Delete stuff",
174-
"help Display more information on a specific command.",
175-
"version Display version information.",
173+
"delete Delete stuff",
174+
"help Display more information on a specific command.",
175+
"version Display version information.",
176176
})]
177177
[InlineData("move --help", false, new string[]
178178
{

0 commit comments

Comments
 (0)