private void WriteArgument(ArgumentHelp argumentHelp, int longestNameWidth, int longestAliasWidth, int descriptionWidth, int leftWidth) { var name = $"-{argumentHelp.PropertyName}".PadRight(longestNameWidth); var aliasString = $"[{argumentHelp.AliasString}]".PadRight(longestAliasWidth); Console.Write(name, GetNameForeground(argumentHelp)); Console.Write(aliasString); var descriptionLines = GetWrappedStrings(argumentHelp.Description, descriptionWidth).ToList(); Console.WriteLine(descriptionLines[0]); foreach (var part in descriptionLines.Skip(1)) { Console.WriteLine(" ".PadLeft(leftWidth) + part); } }
protected virtual void BeforerArgument(ArgumentHelp help) { }
protected virtual ConsoleColor GetNameForeground(ArgumentHelp info) { return(info.Required ? ConsoleColor.Red : Console.ForegroundColor); }
protected virtual void AfterArgument(ArgumentHelp help) { }