-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppBuilder.cs
41 lines (35 loc) · 1.38 KB
/
AppBuilder.cs
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
using Micro.Commands;
using Micro.Commands.Utilities;
using Micro.Utilities;
using Spectre.Console.Cli;
namespace Micro;
public static class AppBuilder
{
public static CommandApp Build()
{
var app = new CommandApp();
app.Configure(config =>
{
config.SetApplicationVersion(Configuration.Version);
// config.PropagateExceptions();
config.AddDelegate("help", _ => Help.Delegate(app));
// TODO: cp, find, rename, chat, editor
config.AddCommand<ChangeDirectoryCommand>("cd");
config.AddCommand<ClearCommand>("clear");
config.AddCommand<ExitCommand>("exit");
config.AddCommand<GetCommand>("get");
config.AddCommand<HistoryCommand>("history");
config.AddCommand<ListContentsCommand>("ls");
config.AddCommand<MakeDirectoryCommand>("mkdir");
config.AddCommand<MoveCommand>("mv");
config.AddCommand<PutCommand>("put");
config.AddCommand<PrintWorkingDirectoryCommand>("pwd");
config.AddCommand<RemoveCommand>("rm");
config.AddCommand<StatusCommand>("stat");
config.AddCommand<TouchCommand>("touch");
config.AddCommand<VersionCommand>("version");
config.AddCommand<UsernameCommand>("whoami");
});
return app;
}
}