| | | 1 | | using System.ComponentModel; |
| | | 2 | | using Spectre.Console; |
| | | 3 | | using Spectre.Console.Cli; |
| | | 4 | | |
| | | 5 | | namespace Orchestrator.Commands.Utility.UploadContext; |
| | | 6 | | |
| | | 7 | | public sealed class UploadContextSettings : CommandSettings |
| | | 8 | | { |
| | | 9 | | [CommandOption("--input <PATH>")] |
| | | 10 | | [Description("Path to a context document JSON file with documentName, content, and communityContext")] |
| | 1 | 11 | | public string Input { get; set; } = string.Empty; |
| | | 12 | | |
| | | 13 | | [CommandOption("--competition <COMPETITION>")] |
| | | 14 | | [Description("Competition identifier (defaults from the JSON community context)")] |
| | | 15 | | public string? Competition { get; set; } |
| | | 16 | | |
| | | 17 | | [CommandOption("--dry-run")] |
| | | 18 | | [Description("Validate and show the upload without writing Firestore documents")] |
| | | 19 | | [DefaultValue(false)] |
| | | 20 | | public bool DryRun { get; set; } |
| | | 21 | | |
| | | 22 | | [CommandOption("-v|--verbose")] |
| | | 23 | | [Description("Enable verbose output")] |
| | | 24 | | [DefaultValue(false)] |
| | | 25 | | public bool Verbose { get; set; } |
| | | 26 | | |
| | | 27 | | public override ValidationResult Validate() |
| | | 28 | | { |
| | 1 | 29 | | return string.IsNullOrWhiteSpace(Input) |
| | 1 | 30 | | ? ValidationResult.Error("--input is required") |
| | 1 | 31 | | : ValidationResult.Success(); |
| | | 32 | | } |
| | | 33 | | } |