ToolBelt.CommandLineParser.GetExampleHelpLines C# (CSharp) Method

GetExampleHelpLines() private method

private GetExampleHelpLines ( int lineLength, StringBuilder helpText ) : void
lineLength int
helpText StringBuilder
return void
        private void GetExampleHelpLines(int lineLength, StringBuilder helpText)
        {
            object[] attributes = this.argTargetType.GetCustomAttributes(typeof(CommandLineExampleAttribute), true);

            if (attributes.Length == 0)
                return;

            CommandLineExampleAttribute attribute = (CommandLineExampleAttribute)attributes[0];

            string example = ExternalGetString(attribute.Example);
            string[] exampleLines = StringUtility.WordWrap(example, (lineLength - 1) - 22);

            helpText.AppendFormat("{0}{1}{1}", CommandLineParserResources.Examples_Propercase, Environment.NewLine);

            for (int i = 0; i < exampleLines.Length; i++)
            {
                helpText.AppendFormat("  {0}{1}", exampleLines[i], Environment.NewLine);
            }

            helpText.AppendLine();
        }