-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (31 loc) · 1.13 KB
/
Program.cs
File metadata and controls
42 lines (31 loc) · 1.13 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
using Spectre.Console.Cli;
using task_cli.Utils;
FileUtils.checkAndCreateDataFile(false);
var app = new CommandApp();
app.Configure(it =>
{
it.SetApplicationName("task");
it.AddCommand<AddTasksCommand>("add")
.WithAlias("a")
.WithDescription("Add a task to the to-do list")
.WithExample(new[] { "a", "\"Do homework\"" });
it.AddCommand<MarkTasksCommand>("markdone")
.WithAlias("md")
.WithDescription("Mark a task (specified by task number) as done or undone (true/false)")
.WithExample(new[] { "md", "1", "false" });
it.AddCommand<DeleteTaskCommand>("delete")
.WithAlias("del")
.WithDescription("Delete a task (specified by task number)")
.WithExample(new[] { "del", "1", });
it.AddCommand<ListTasksCommand>("list")
.WithAlias("ls")
.WithDescription("List all saved tasks");
it.AddCommand<ClearAllTasksCommand>("clear")
.WithAlias("cls")
.WithDescription("Delete all saved tasks");
it.AddCommand<SearchTasksCommand>("search")
.WithDescription("Search for tasks in the saved task list");
it.AddCommand<WeatherConfigCommand>("weather")
.WithDescription("Set data for weather displaying when listing tasks");
});
app.Run(args);