Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 protected virtual void BeforerArgument(ArgumentHelp help)
 {
 }
Ejemplo n.º 3
0
 protected virtual ConsoleColor GetNameForeground(ArgumentHelp info)
 {
     return(info.Required ? ConsoleColor.Red : Console.ForegroundColor);
 }
Ejemplo n.º 4
0
 protected virtual void AfterArgument(ArgumentHelp help)
 {
 }