-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathOsCommand.cs
More file actions
36 lines (30 loc) · 793 Bytes
/
OsCommand.cs
File metadata and controls
36 lines (30 loc) · 793 Bytes
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
using System.CommandLine;
using Spectre.Console;
using VmChamp;
public class OsCommand : Command
{
private readonly AppConfig _appConfig;
public OsCommand(AppConfig appConfig) : base("os", "get a list of all available os images")
{
_appConfig = appConfig;
this.AddAlias("images");
this.SetHandler(() =>
{
var table = new Table();
table.AddColumn("OS");
table.AddColumn("Distro");
table.AddColumn("Alias");
table.AddColumn("Image");
table.AddColumn("Url");
foreach (var distro in DistroInfo.Distros)
{
table.AddRow(distro.Name,
distro.Family,
string.Join(", ", distro.Aliases),
distro.ImageName,
distro.Url);
}
AnsiConsole.Write(table);
});
}
}