-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
66 lines (48 loc) · 2.44 KB
/
Copy pathProgram.cs
File metadata and controls
66 lines (48 loc) · 2.44 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System.CommandLine;
using ModerBox.Cli.Infrastructure;
using ModerBox.Cli.Commands;
namespace ModerBox.Cli;
class Program
{
static async Task<int> Main(string[] args)
{
// Set JSON mode from args before parsing
GlobalJsonOption.IsJsonMode = args.Contains("--json") || args.Contains("-j");
var rootCommand = new RootCommand("ModerBox CLI - 电力系统工具箱命令行版本");
// Global --json option
var jsonOption = new Option<bool>(
name: "--json",
description: "Output as machine-readable JSON");
rootCommand.AddGlobalOption(jsonOption);
// Register all 12 commands
RegisterSubcommands(rootCommand);
return await rootCommand.InvokeAsync(args);
}
static void RegisterSubcommands(RootCommand rootCommand)
{
// 1. HarmonicCommand - harmonic (h) - 谐波计算
rootCommand.Add(HarmonicCommand.Create());
// 2. FilterWaveformCommand - filter (f) - 滤波器分合闸波形检测
rootCommand.Add(FilterWaveformCommand.Create());
// 3. CurrentDifferenceCommand - current-diff (cd) - 接地极电流差值分析
rootCommand.Add(CurrentDifferenceCommand.Create());
// 4. QuestionBankCommand - question-bank (qb) - 题库转换
rootCommand.Add(QuestionBankCommand.Create());
// 5. CableRoutingCommand - cable (c) - 电缆走向绘制
rootCommand.Add(CableRoutingCommand.Create());
// 6. ContributionCommand - contribution (ctb) - 工作票贡献度计算
rootCommand.Add(ContributionCommand.Create());
// 7. FilterCopyCommand - filter-copy (fc) - 分合闸波形筛选复制
rootCommand.Add(FilterCopyCommand.Create());
// 8. SwitchReportCommand - switch-report (sr) - 分合闸操作报表
rootCommand.Add(SwitchReportCommand.Create());
// 9. PeriodicWorkCommand - periodic-work (pw) - 内置录波定期工作
rootCommand.Add(PeriodicWorkCommand.Create());
// 10. ThreePhaseIdeeCommand - threephase-idee (idee, idee-idel subcommands) - 三相IDEE分析
rootCommand.Add(ThreePhaseIdeeCommand.Create());
// 11. ComtradeExportCommand - comtrade-export (list, export subcommands) - COMTRADE通道导出
rootCommand.Add(ComtradeExportCommand.Create());
// 12. VideoCommand - video (analyze, folder subcommands) - 视频分析
rootCommand.Add(VideoCommand.Create());
}
}