feat: scaffold CLI project with ClusterClient connection and System.CommandLine

This commit is contained in:
Joseph Doherty
2026-03-17 14:51:43 -04:00
parent 1942544769
commit 229287cfd2
6 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System.CommandLine;
using System.CommandLine.Parsing;
var rootCommand = new RootCommand("ScadaLink CLI — manage the ScadaLink SCADA system");
var contactPointsOption = new Option<string>("--contact-points") { Description = "Comma-separated cluster contact points", Recursive = true };
var usernameOption = new Option<string>("--username") { Description = "LDAP username", Recursive = true };
var passwordOption = new Option<string>("--password") { Description = "LDAP password", Recursive = true };
var formatOption = new Option<string>("--format") { Description = "Output format (json or table)", Recursive = true };
formatOption.DefaultValueFactory = _ => "json";
rootCommand.Add(contactPointsOption);
rootCommand.Add(usernameOption);
rootCommand.Add(passwordOption);
rootCommand.Add(formatOption);
// Placeholder — command groups will be added in Task 6
rootCommand.SetAction(_ =>
{
Console.WriteLine("Use --help to see available commands.");
});
var parseResult = CommandLineParser.Parse(rootCommand, args);
return await parseResult.InvokeAsync();