-
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.21 KB
/
Program.cs
File metadata and controls
42 lines (31 loc) · 1.21 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 Cocona;
using Spectre.Console;
using Microsoft.Extensions.DependencyInjection;
using PulseFetch.Commands;
using PulseFetch.Core;
// ────────────────────────────────────────────────────────────
// DI & builder
var builder = CoconaApp.CreateBuilder();
builder.Services.AddSingleton<DownloadService>();
var app = builder.Build();
// Register commands *before* showing splash so help output stays pretty
app.AddCommands<DownloadCommands>();
Splash.Show();
await app.RunAsync();
// ────────────────────────────────────────────────────────────
// Pretty ASCII splash (Spectre.Console)
static class Splash
{
private static bool _shown;
public static void Show()
{
if (_shown) return;
_shown = true;
AnsiConsole.Write(
new FigletText("PulseFetch")
.Centered()
.Color(Color.Green1));
AnsiConsole.MarkupLine("[Green1]Your Downloads, With a Heartbeat 💓[/]");
AnsiConsole.WriteLine();
}
}