Join IEnumerable defaults with separator instead of space
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start in src/CommandLine/Text/HelpText.cs around line 1125, where default IEnumerable values are formatted for help output. Trace how the option's configured separator is available during formatting, then verify the sample's --help output uses commas between AAA, BBB, and CCC so the displayed default can be copied as an argument.
Written by the indexing model from the issue text.
Description
Source:
#:package CommandLineParser@2.9.1
using CommandLine;
return Parser.Default.ParseArguments<Opts>(args).MapResult(
(Opts opts) => 0,
errors => 2
);
class Opts {
[Option("opt", Required = true, Separator = ',', Default = new[] { "AAA", "BBB", "CCC" }, HelpText = "boolean arg.")]
public IEnumerable<string> MyOption { get; set; }
}
Output with --help:
test_cmdline 1.0.0
Copyright (C) 2026 test_cmdline
--opt Required. (Default: AAA BBB CCC) boolean arg.
--help Display this help screen.
--version Display version information.
Notice that the default argument's values are joined by spaces, which is misleading.
Since a separator is provided it should be used instead, so that the user could just copy-paste the resulting value directly and use it as argument. Currently there is no way to achieve this: see here.
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 478
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from commandlineparser/commandline
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
commandlineparser/commandline#880 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
commandlineparser/commandline#952 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
commandlineparser/commandline#948 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
commandlineparser/commandline#947 ·
-
awaiting response
Difficulty 5/5 Over a week Newbie friendliness 25/100
commandlineparser/commandline#945 · 1 comment ·
All issues in commandlineparser/commandline
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·