Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix spacing on help messages when verbs have aliases #650

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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