diff --git a/SabreTools.CommandLine/Inputs/UserInput.cs b/SabreTools.CommandLine/Inputs/UserInput.cs index e4e41ab..3a187af 100644 --- a/SabreTools.CommandLine/Inputs/UserInput.cs +++ b/SabreTools.CommandLine/Inputs/UserInput.cs @@ -12,14 +12,20 @@ namespace SabreTools.CommandLine.Inputs #region Properties /// - /// Display name for the feature + /// Reference name for the input /// - public string Name { get; protected set; } + /// This value should be unique across user inputs + public string Name { get; } /// - /// Set of children associated with this input + /// Short description of the input /// - public readonly Dictionary Children = []; + public string Description { get; } + + /// + /// Optional detailed description of the input + /// + private string? LongDescription { get; } #endregion @@ -31,14 +37,9 @@ namespace SabreTools.CommandLine.Inputs protected readonly List Flags = []; /// - /// Short description of the feature + /// Set of children associated with this input /// - private readonly string _description; - - /// - /// Optional long description of the feature - /// - private readonly string? _longDescription; + protected readonly Dictionary Children = []; #endregion @@ -48,16 +49,16 @@ namespace SabreTools.CommandLine.Inputs { Name = name; Flags.Add(flag); - _description = description; - _longDescription = longDescription; + Description = description; + LongDescription = longDescription; } public UserInput(string name, string[] flags, string description, string? longDescription = null) { Name = name; Flags.AddRange(flags); - _description = description; - _longDescription = longDescription; + Description = description; + LongDescription = longDescription; } #endregion @@ -704,7 +705,7 @@ namespace SabreTools.CommandLine.Inputs output.Append(CreatePadding(pre)); output.Append(FormatFlags()); output.Append(CreatePadding(midpointPadding)); - output.Append(_description); + output.Append(Description); return output.ToString(); } @@ -717,11 +718,11 @@ namespace SabreTools.CommandLine.Inputs internal List FormatLongDescription(int pre) { // If the long description is null or empty - if (string.IsNullOrEmpty(_longDescription)) + if (string.IsNullOrEmpty(LongDescription)) return []; // Normalize the description for output - string longDescription = _longDescription!.Replace("\r\n", "\n"); + string longDescription = LongDescription!.Replace("\r\n", "\n"); longDescription = longDescription.Replace("\n", "\n "); // Get the width of the console for wrapping reference