Пример #1
0
        private static void WriteExample(string syntax, string explanation)
        {
            ParagraphHelper paragraphHelper = new ParagraphHelper();

            s_helpBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", syntax));
            s_helpBuilder.AppendLine(paragraphHelper.AddIndentation(string.Format(CultureInfo.InvariantCulture, "    {0}", explanation), indentLength: 4));
            s_helpBuilder.AppendLine();
        }
Пример #2
0
            public static void WriteArguments(ArgumentInfo[] arguments)
            {
                int    maxArgumentnLength = CalculateMaxNameLength(arguments);
                int    helpTextIndent     = argHelpPrefix.Length + maxArgumentnLength + argHelpSeperator.Length;
                string helpPattern        = argHelpPrefix + "{0, -" + maxArgumentnLength + "}" + argHelpSeperator + "{1}";

                ParagraphHelper paragraphHelper = new ParagraphHelper();

                foreach (ArgumentInfo argument in arguments)
                {
                    if (argument.BeginGroup)
                    {
                        s_helpBuilder.AppendLine();
                    }

                    string optionHelp = argument.GenerateHelp(helpPattern);
                    s_helpBuilder.AppendLine(paragraphHelper.AddIndentation(optionHelp, helpTextIndent));
                }
            }