9cff87fe85
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
51 lines
3.1 KiB
C#
51 lines
3.1 KiB
C#
using System.CommandLine;
|
|
using System.CommandLine.Parsing;
|
|
using ZB.MOM.WW.ScadaBridge.CLI.Commands;
|
|
|
|
var rootCommand = new RootCommand("ScadaBridge CLI — manage the ScadaBridge SCADA system");
|
|
|
|
var urlOption = new Option<string>("--url") { Description = "Management API URL", Recursive = true };
|
|
var usernameOption = new Option<string>("--username") { Description = "LDAP username", Recursive = true };
|
|
var passwordOption = new Option<string>("--password") { Description = "LDAP password", Recursive = true };
|
|
// No DefaultValueFactory: format precedence (explicit --format -> config/env -> "json")
|
|
// is resolved by CommandHelpers.ResolveFormat, which needs to distinguish an absent flag.
|
|
// CliOptions.CreateFormatOption also constrains the accepted values (json/table).
|
|
var formatOption = CliOptions.CreateFormatOption();
|
|
|
|
rootCommand.Add(urlOption);
|
|
rootCommand.Add(usernameOption);
|
|
rootCommand.Add(passwordOption);
|
|
rootCommand.Add(formatOption);
|
|
|
|
// Register command groups
|
|
rootCommand.Add(TemplateCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(InstanceCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(SiteCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(DeployCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(DataConnectionCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(ExternalSystemCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(NotificationCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(SecurityCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(AuditLogCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(AuditCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(HealthCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(DebugCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(SharedScriptCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(DbConnectionCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(ApiMethodCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(BundleCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
rootCommand.Add(CachedCallCommands.Build(urlOption, formatOption, usernameOption, passwordOption));
|
|
|
|
rootCommand.SetAction(_ =>
|
|
{
|
|
Console.WriteLine("Use --help to see available commands.");
|
|
});
|
|
|
|
// Deprecation notice for the earlier `audit-log` command name. The command itself
|
|
// still works (it is an alias of `audit-config`), but using the old name emits a
|
|
// warning to stderr so scripts can be migrated.
|
|
AuditLogCommands.WriteDeprecationWarningIfNeeded(args, Console.Error);
|
|
|
|
var parseResult = CommandLineParser.Parse(rootCommand, args);
|
|
return await parseResult.InvokeAsync();
|