-
Notifications
You must be signed in to change notification settings - Fork 263
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (35 loc) · 1.38 KB
/
Program.cs
File metadata and controls
43 lines (35 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using McMaster.Extensions.CommandLineUtils;
namespace ResponseFileParsing
{
class Program
{
public static int Main(string[] args)
{
var app = new CommandLineApplication
{
Name = "done",
Description = "Keep track on things you've done",
ResponseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated
};
app.HelpOption(inherited: true);
var argumentDescription = app.Argument("Description", "The description of what you've done");
var optionTags = app.Option("-t|--tag <TAGS>", "A tag for the item", CommandOptionType.MultipleValue);
app.Command("list", listCommand =>
{
listCommand.ResponseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated;
var optionListTags = listCommand.Option("-t|--tag <TAGS>", "Only list items with the corresponding tag(s)", CommandOptionType.MultipleValue);
listCommand.OnExecute(() =>
{
//...
});
});
app.OnExecute(() =>
{
//...
});
return app.Execute(args);
}
}
}