Skip to content

Commit 5b1bdbe

Browse files
committed
changed help options joins , instead of |
1 parent 7666bc9 commit 5b1bdbe

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Usage: [options...] [-h|--help] [--version]
260260
Display Hello.
261261
262262
Options:
263-
-m|--message <string> Message to show. (Required)
263+
-m, --message <string> Message to show. (Required)
264264
```
265265

266266
To add aliases to parameters, list the aliases separated by `|` before the comma in the comment. For example, if you write a comment like `-a|-b|--abcde, Description.`, then `-a`, `-b`, and `--abcde` will be treated as aliases, and `Description.` will be the description.
@@ -342,7 +342,7 @@ Usage: [command] [options...] [-h|--help] [--version]
342342
Root command test.
343343
344344
Options:
345-
-m|--msg <string> Message to show. (Required)
345+
-m, --msg <string> Message to show. (Required)
346346
347347
Commands:
348348
echo Display message.

src/ConsoleAppFramework/CommandHelpBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static string BuildOptionsMessage(CommandHelpDefinition definition)
161161
var optionsFormatted = definition.Options
162162
.Where(x => !x.Index.HasValue)
163163
.Where(x => !x.IsHidden)
164-
.Select(x => (Options: string.Join("|", x.Options) + (x.IsFlag ? string.Empty : $" {x.FormattedValueTypeName}{(x.IsParams ? "..." : "")}"), x.Description, x.IsRequired, x.IsFlag, x.DefaultValue, x.IsDefaultValueHidden))
164+
.Select(x => (Options: string.Join(", ", x.Options) + (x.IsFlag ? string.Empty : $" {x.FormattedValueTypeName}{(x.IsParams ? "..." : "")}"), x.Description, x.IsRequired, x.IsFlag, x.DefaultValue, x.IsDefaultValueHidden))
165165
.ToArray();
166166

167167
if (!optionsFormatted.Any()) return string.Empty;

tests/ConsoleAppFramework.GeneratorTests/HelpTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void HelloWorld(string fooBar)
203203
hello my world.
204204
205205
Options:
206-
-f|-fb|--foo-bar <string> my foo is not bar. (Required)
206+
-f, -fb, --foo-bar <string> my foo is not bar. (Required)
207207
208208
""");
209209
}
@@ -316,7 +316,7 @@ hello my world.
316316
[0] <int> my boo is not boo.
317317
318318
Options:
319-
-f|-fb|--foo-bar <string> my foo, is not bar. (Required)
319+
-f, -fb, --foo-bar <string> my foo, is not bar. (Required)
320320
321321
""");
322322
}
@@ -342,7 +342,7 @@ static class Commands
342342
Display Hello.
343343
344344
Options:
345-
-m|--message <string> Message to show.
345+
-m, --message <string> Message to show.
346346
347347
""");
348348
}
@@ -376,7 +376,7 @@ public void GlobalOptions()
376376
--y <int> (Required)
377377
--parameter <int> param global (Default: 1000)
378378
--dry-run run dry dry (Optional)
379-
--p2|--p3 <int> param 2 (Required)
379+
--p2, --p3 <int> param 2 (Required)
380380
381381
""");
382382
}

0 commit comments

Comments
 (0)