25 lines
1.0 KiB
C#
25 lines
1.0 KiB
C#
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();
|