Skip to content

Commit 79c899e

Browse files
committed
customized help
1 parent cec7640 commit 79c899e

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

src/Program.cs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,38 @@
88
Name = "linecount"
99
};
1010

11-
var filterOption = new Option<string>(["-f", "--filter"], "A glob-pattern for files to include.");
12-
var lineFilterOption = new Option<string>(["-l", "--line-filter"], "A RegEx for the lines to count.");
13-
var exceptFilterOption = new Option<string>(["-x", "--exclude-filter"], "A glob-pattern for files not to include.");
14-
var exceptLineFilterOption = new Option<string>(["-w", "--exlude-line-filter"], "A RegEx for the lines not to count.");
11+
var filterOption = new Option<string>(["-f", "--filter"], "A glob-pattern for files to include.")
12+
{
13+
ArgumentHelpName = "pattern"
14+
};
15+
var lineFilterOption = new Option<string>(["-l", "--line-filter"], "A RegEx for the lines to count.")
16+
{
17+
ArgumentHelpName = "pattern"
18+
};
19+
var exceptFilterOption = new Option<string>(["-x", "--exclude-filter"], "A glob-pattern for files not to include.")
20+
{
21+
ArgumentHelpName = "pattern"
22+
};
23+
var exceptLineFilterOption = new Option<string>(["-w", "--exlude-line-filter"], "A RegEx for the lines not to count.")
24+
{
25+
ArgumentHelpName = "pattern"
26+
};
1527
var listFilesOption = new Option<bool>("--list", "Whether to list the files as they are being processed.");
16-
var formatOption = new Option<Format>("--format", "The output format of the result.");
28+
var formatOption = new Option<Format>("--format", "The output format of the result.")
29+
{
30+
ArgumentHelpName = "normal|raw|json"
31+
};
1732
var excludeDirectoriesOption = new Option<string[]>("--exclude-directories", "A list of directories to exclude.")
1833
{
1934
Arity = ArgumentArity.OneOrMore,
20-
AllowMultipleArgumentsPerToken = true
35+
AllowMultipleArgumentsPerToken = true,
36+
ArgumentHelpName = "directories"
2137
};
2238
var excludeFilesOption = new Option<string[]>("--exclude-files", "A list of files to exclude.")
2339
{
2440
Arity = ArgumentArity.OneOrMore,
25-
AllowMultipleArgumentsPerToken = true
41+
AllowMultipleArgumentsPerToken = true,
42+
ArgumentHelpName = "files"
2643
};
2744

2845
var pathArgument = new Argument<string>("path", "The path to the file or the directory that contains the files to calculate the count of. Use '.' to refer to the current directory.");

0 commit comments

Comments
 (0)