CommandLine.Text.HelpText.AddPreOptionsLine C# (CSharp) Method

AddPreOptionsLine() public method

Adds a text line after copyright and before options usage informations.
Thrown when parameter is null or empty string.
public AddPreOptionsLine ( string value ) : void
value string A instance.
return void
        public void AddPreOptionsLine(string value)
        {
            AddLine(this.preOptionsHelp, value);
        }

Usage Example

Exemplo n.º 1
0
        public string GetUsage()
        {
            var help = new HelpText
            {
                Copyright = new CopyrightInfo("MasterDevs", 2015),
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true,
            };
            help.AddPreOptionsLine("Usage: tidyJson [OPTIONS]");
            help.AddPreOptionsLine("Uses standard in and standard out if input or output not supplied");
            help.AddPostOptionsLine("Examples:");
            help.AddPostOptionsLine("    echo {json:'value'} | tidyJson");
            help.AddPostOptionsLine("        Read JSON from standard input and write it to standard output");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("    tidyJson -c");
            help.AddPostOptionsLine("        Read JSON from clipboard and write it back to the clipboard");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("    tidyJson -f myOutput.json");
            help.AddPostOptionsLine("        Read JSON from standard input and write it to the file myOutput.json");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("    tidyJson -i myInput.json");
            help.AddPostOptionsLine("        Read JSON from the file myInput.Json and write it to standard output");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("    tidyJson -i myInput.json -f myOutput.json");
            help.AddPostOptionsLine("        Read JSON from the file myInput.Json and write it to the file myOutput.json");

            help.AddOptions(this);
            return help;

            //return HelpText.AutoBuild(this,
            //  (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
All Usage Examples Of CommandLine.Text.HelpText::AddPreOptionsLine