public string GetUsage()
        {
            string processname = Process.GetCurrentProcess().ProcessName;

            var help = new HelpText
            {
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true,
                Copyright = new CopyrightInfo("Geoffrey Huntley <*****@*****.**>", DateTime.Now.Year),
                MaximumDisplayWidth = 160,
            };

            help.AddPreOptionsLine(Environment.NewLine);
            help.AddPreOptionsLine(
                String.Format(
                    "Usage: {0} --destination C:\\backups\\ --sleep 600 --instance https://yourinstance.atlassian.net --username admin --password password",
                    processname));

            help.AddOptions(this);

            if (LastParserState.Errors.Count <= 0) return help;

            string errors = help.RenderParsingErrorsText(this, 2); // indent with two spaces
            if (!string.IsNullOrEmpty(errors))
            {
                help.AddPostOptionsLine(Environment.NewLine);
                help.AddPostOptionsLine("ERROR(s):");help.AddPostOptionsLine(Environment.NewLine);
                help.AddPostOptionsLine(errors);
            }

            return help;
        }
示例#2
0
 public string GetUsage()
 {
     var help = new HelpText()
     {
         AddDashesToOption = true
     };
     help.AddPreOptionsLine("For details regarding Roku development, visit http://sdkdocs.roku.com/display/sdkdoc/Developer+Guide");
     help.AddPreOptionsLine("");
     help.AddPreOptionsLine("Usage:");
     help.AddPostOptionsLine("Example:   rokuloader -h 192.168.1.10 -p password -z c:\\rokudev\\package.zip");
     help.AddPostOptionsLine("");
     help.AddOptions(this);
     return help;
 }
示例#3
0
 internal void AddToHelpText(HelpText helpText, bool before)
 {
     if (before)
     {
         if (!string.IsNullOrEmpty(_line1))
         {
             helpText.AddPreOptionsLine(_line1);
         }
         if (!string.IsNullOrEmpty(_line2))
         {
             helpText.AddPreOptionsLine(_line2);
         }
         if (!string.IsNullOrEmpty(_line3))
         {
             helpText.AddPreOptionsLine(_line3);
         }
         if (!string.IsNullOrEmpty(_line4))
         {
             helpText.AddPreOptionsLine(_line4);
         }
         if (!string.IsNullOrEmpty(_line5))
         {
             helpText.AddPreOptionsLine(_line5);
         }
     }
     else
     {
         if (!string.IsNullOrEmpty(_line1))
         {
             helpText.AddPostOptionsLine(_line1);
         }
         if (!string.IsNullOrEmpty(_line2))
         {
             helpText.AddPostOptionsLine(_line2);
         }
         if (!string.IsNullOrEmpty(_line3))
         {
             helpText.AddPostOptionsLine(_line3);
         }
         if (!string.IsNullOrEmpty(_line4))
         {
             helpText.AddPostOptionsLine(_line4);
         }
         if (!string.IsNullOrEmpty(_line5))
         {
             helpText.AddPostOptionsLine(_line5);
         }
     }
 }
        public string GetUsage()
        {
            var help = new HelpText {
                Heading = new HeadingInfo("PIXIE", typeof(Program).Assembly.GetName().Version.ToString()),
                Copyright = new CopyrightInfo("PNNL", 2015),
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

            help.AddPostOptionsLine("  Example: PIXIE [YourData.UIMF]");
            help.AddPostOptionsLine("  Example: PIXIE [YourData1.UIMF] [YourData2.UIMF] [YourData3.UIMF]...");
            help.AddPostOptionsLine(string.Empty);
            help.AddOptions(this);
            return help;
        }
        public string GetUsage()
        {
            var help = new HelpText
                           {
                                Heading = "Pluggable Workers Runner",
                                Copyright = new CopyrightInfo("Lazy Developers Group, LLC", 2012),
                                AddDashesToOption = true
                           };

            help.AddPreOptionsLine("This application supports the following command line arguments.");
            help.AddPostOptionsLine("Short parameters must be prefixed with a single dash, long names by two dashes.");
            help.AddPostOptionsLine("Parameters values of more than one word must be enclosed in quotes.");
            help.AddPostOptionsLine("\n\n");
            help.AddOptions(this);

            return help;
        }
示例#6
0
 internal HelpText AddToHelpText(HelpText helpText, bool before)
 {
     // before flag only distinguishes which action is called,
     // so refactor common code and call with appropriate func
     return(before
         ? this.AddToHelpText(helpText, line => helpText.AddPreOptionsLine(line))
         : this.AddToHelpText(helpText, line => helpText.AddPostOptionsLine(line)));
 }
示例#7
0
 public string GetUsage()
 {
     var help = new HelpText
     {
         Heading = new HeadingInfo("WamsTop", "0.1"),
         Copyright = new CopyrightInfo("Tobias Weisserth", 2013),
         AdditionalNewLineAfterOption = true,
         AddDashesToOption = true
     };
     help.AddPreOptionsLine("Apache License, Version 2.0");
     help.AddPreOptionsLine("");
     help.AddPreOptionsLine("Usage: WamsTop.exe -e|-entity [Assets|Jobs|Processors] [-v] [-d]");
     help.AddOptions(this);
     help.AddPostOptionsLine("");
     help.AddPostOptionsLine("Under development, please check https://github.com/polarapfel/WamsTop for latest release!");
     help.AddPostOptionsLine("");
     return help;
 }
 public string GetUsage()
 {
     var help = new HelpText("Windows S3 Uploader");
       help.Copyright = new CopyrightInfo("Palomino Labs, Inc.", 2012);
       help.AddPreOptionsLine("Command options:");
       help.AddOptions(this);
       help.AddPostOptionsLine("Omit accessKey and secretKey to get credentials from IAM");
       return help;
 }
示例#9
0
文件: Program.cs 项目: nojima/GMF
 public string GetUsage()
 {
     var help = new HelpText {
         AddDashesToOption = true,
         Heading = "Usage: AccuracyExperiment [OPTIONS]",
     };
     help.AddPostOptionsLine("詳しくは ReadMe.md を参照.\n");
     help.AddOptions(this);
     return help;
 }
示例#10
0
文件: Program.cs 项目: nojima/GMF
 public string GetUsage()
 {
     var help = new HelpText {
         AddDashesToOption = true,
         Heading = "Usage: GeneralizedMaximumFlow [OPTIONS]",
     };
     help.AddPostOptionsLine("詳しくは ReadMe.md を参照.\n");
     help.AddOptions(this);
     return help;
 }
        public String GetUsage()
        {
            var help = new HelpText(new HeadingInfo("MsBuilderific", "1.0.1").ToString()){
                MaximumDisplayWidth = Console.WindowWidth, 
                Copyright = new CopyrightInfo("Vooban Inc.", 2011)
            };

            help.AddPreOptionsLine("Usage : MsBuilderific.Console -r C:\\Sources -e C:\\Sources\\test.csproj;C:\\Sources\\Obsolete;");
            help.AddPreOptionsLine("");
            help.AddOptions(this);
            help.AddPostOptionsLine("\r\n"); 

            return help;
        }        
        public String GetUsage()
        {
            var help = new HelpText(new HeadingInfo("MsBuild Visitor", null).ToString())
            {
                MaximumDisplayWidth = Console.WindowWidth,
                Copyright = new CopyrightInfo("Vooban Inc.", 2011)
            };

            help.AddPreOptionsLine("");
            help.AddOptions(this);
            help.AddPostOptionsLine("\r\n"); 

            return help;
        }
        public string GetUsage()
        {
            Assembly assembly = Assembly.GetEntryAssembly();
            AssemblyName assemblyName = assembly.GetName();
            HelpText help = new HelpText
            {
                Heading = new HeadingInfo(assemblyName.Name, assemblyName.Version.ToString()),
                Copyright = new CopyrightInfo("CHECK24", 2013),
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true
            };

            help.AddPreOptionsLine(string.Format("Usage: {0} (-o|--option) value?", Path.GetFileName(assembly.Location)));
            help.AddOptions(this);
            help.AddPostOptionsLine(Environment.NewLine);

            return help;
        }
示例#14
0
        public string GetUsage()
        {
            var help = new HelpText {
                Heading = "arcomp is a simple command-line utility used to compare archives or show their content.",
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

            HandleParsingErrorsInHelp(help);
            help.AddPreOptionsLine("Password-protected archives are not supported.");
            help.AddPostOptionsLine(Environment.NewLine + "Usage examples");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("Shows properties and entries of one or more archives:");
            help.AddPostOptionsLine("arcomp -s \"archive 1.zip\" \"..\\another archive 2.rar\" \"C:\\some folder\\other archive 3.7z\"");
            help.AddPostOptionsLine(string.Empty);
            help.AddPostOptionsLine("Compares two archives and shows their difference in properties and entries:");
            help.AddPostOptionsLine("arcomp -c \"archive 1.zip\" \"..\\another archive 2.rar\"");
            help.AddOptions(this);

            return help;
        }
        public string GetUsage()
        {
            var assemblyName = Assembly.GetExecutingAssembly().GetName();
            var help = new HelpText
            {
                Heading = new HeadingInfo("Test Data Generator", assemblyName.Version.ToString()),
                Copyright = new CopyrightInfo("Gary Kenneally (@SecretDeveloper)", 2014),
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true
            };
            help.AddPreOptionsLine("This is free software. You may redistribute copies of it under the terms of the MIT License.");
            help.AddPreOptionsLine(" <http://www.opensource.org/licenses/mit-license.php>");

            help.AddPostOptionsLine("Examples:");
            help.AddPostOptionsLine("\t tdg -t '<<LL>>'");
            help.AddPostOptionsLine("\t tdg -t '<<LL>>' -c 10");
            help.AddPostOptionsLine("\t tdg -t '<<LL>>' -o 'c:\\test.txt' -c 10");
            help.AddPostOptionsLine("\t tdg -i 'c:\\input.txt' -o 'c:\\test.txt' -c 10");
            help.AddPostOptionsLine("Either a Template (-t), Pattern (-p) or input File (-i) value must be provided as input.");
            
            help.AddOptions(this);
            return help;
        }
        public string GetUsage()
        {
            var help = new HelpText
            {
                Heading = new HeadingInfo(ThisAssembly.Product, "v" + ThisAssembly.InformationalVersion),
                Copyright = new CopyrightInfo(ThisAssembly.Author, ThisAssembly.Year),
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true
            };

            help.AddPreOptionsLine("\nBased on Robs Heightmap Parser Code");
            help.AddPreOptionsLine("");
            help.AddPreOptionsLine("Usage: HeightMapGenerator [PRJ-FILE] [OPTION]...");
            help.AddPreOptionsLine("       HeightMapGenerator [PRJ-FILE] [HEIGHTMAP-IMAGE] [OPTION]...");

            help.AddPostOptionsLine("Per default both heightmaps are overwritten with the image, use -1 or -2 to change this.");
            //help.AddPostOptionsLine("Use a 16-Bit TIFF for best results.);
            help.AddPostOptionsLine("");
            help.AddPostOptionsLine("Example: HeightMapGenerator B1_01.PRJ heightmap.png");
            help.AddPostOptionsLine("Overwrites both heightmaps of B1_01.PRJ with the one in heightmap.png");
            help.AddPostOptionsLine("");
            help.AddPostOptionsLine("Enjoy!");

            help.AddOptions(this);

            return help;
        }
示例#17
0
        static void ShowUsage(IList<string> errors = null)
        {
            var help = new HelpText();

            help.Heading = "SizePhotos";
            help.AddPreOptionsLine("A tool to prepare and optimize images for display on the web.");

            // this is a little lame, but force a NotParsed<T> options result
            // so that we can get a nice help screen.  this might be required
            // if the passed args are valid to the parser, but not w/ custom
            // validation logic that runs after parsing
            var parser = new Parser(config => config.HelpWriter = null);
            var result = parser.ParseArguments<SizePhotoOptions>(new string[] { "--xxx" });
            help.AddOptions(result);

            if(errors != null)
            {
                help.AddPostOptionsLine("Errors:");
                help.AddPostOptionsLines(errors);
            }

            Console.WriteLine(help.ToString());
        }
示例#18
0
        public string GetUsage()
        {
            var help = new HelpText
            {
                Heading = new HeadingInfo("#b#Versionr## #q#- the less hateful version control system.##"),
                AddDashesToOption = false,
            };
            help.FormatOptionHelpText += Help_FormatOptionHelpText;

            // ...
            if (LastParserState != null && LastParserState.Errors.Any())
            {
                var errors = help.RenderParsingErrorsText(this, 2); // indent with two spaces

                if (!string.IsNullOrEmpty(errors))
                {
                    help.AddPreOptionsLine(string.Concat(Environment.NewLine, "Invalid command:"));
                    help.AddPreOptionsLine(errors);
                }
            }
            help.AddPreOptionsLine("Usage: #b#versionr## COMMAND #q#[options]## <arguments>\n\n#b#Commands:");
            help.AddOptions(this);
            help.AddPostOptionsLine("##For additional help, use: #b#versionr## COMMAND #b#--help##.");
            help.AddPostOptionsLine("To display version information, use the `#b#--version##` option.\n");
            return help;
        }
示例#19
0
文件: Program.cs 项目: Mikasa/VICI
            public string GetHelp()
            {
                var help = new HelpText(Program.Heading)
                {
                    AdditionalNewLineAfterOption = true,
                    ApplicationName = Heading.ProgramName,
                    Copyright = Program.Copyright,
                    DisplayOptionsWithHyphens = true,
                    MaximumDisplayWidth = System.Console.BufferWidth
                };
                help.AddPreOptionsLine("This is free software. You may redistribute copies of it under the terms of the MIT License <http://www.opensource.org/licenses/mit-license.php>.");

                help.AddPostOptionsLine(" ");

                help.AddOptions(this);
                return help;
            }
示例#20
0
        public void Post_options_lines_feature_added()
        {
            var local = new HelpText("Heading Info.");
            local.AddPreOptionsLine("This is a first pre-options line.");
            local.AddPreOptionsLine("This is a second pre-options line.");
            local.AddOptions(new MockOptions());
            local.AddPostOptionsLine("This is a first post-options line.");
            local.AddPostOptionsLine("This is a second post-options line.");

            string help = local.ToString();

            string[] lines = help.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            lines[lines.Length - 2].Should().Be("This is a first post-options line.");
            lines[lines.Length - 1].Should().Be("This is a second post-options line.");
        }
示例#21
0
        public string GetUsage()
        {
            var help = new HelpText("\nSTAHC Utility");
            help.AddPreOptionsLine("This utility takes a collection of files and settings, uploads them to the");
            help.AddPreOptionsLine("Windows Azure platform and then deploys them. Also provided are methods for ");
            help.AddPreOptionsLine("terminating the operation and cleaning up after one is done. ");
            help.AddOptions(this);
            help.AddPostOptionsLine("\n");

            return help;
        }
示例#22
0
 public string GetUsage()
 {
     var help = new HelpText()
     {
         Heading = new HeadingInfo("FILEter", "0.1"),
         Copyright = new CopyrightInfo("Michael Yeaple", 2016),
         AdditionalNewLineAfterOption = true,
         AddDashesToOption = true
     };
     help.AddPreOptionsLine("FILEter is a flat file filtering program.");
     help.AddOptions(new Options());
     help.AddPostOptionsLine("At least one filterValue (-f) or filterFile (-F) argument is required.");
     return help;
 }
示例#23
0
 public string GetUsage()
 {
     var help = new HelpText { AddDashesToOption = true };
     help.AddOptions(this);
     help.AddPostOptionsLine("Image generator. One of: "+GetGeneratorsNames());
     return help;
 }
示例#24
0
        public void Instancing_with_parameterless_constructor()
        {
            var year = DateTime.Now.Year;
            var local = new HelpText();
            local.Heading = new HeadingInfo("Parameterless Constructor Test.");
            local.Copyright = new CopyrightInfo("Author", year);
            local.AddPreOptionsLine("Pre-Options.");
            local.AddOptions(new MockOptionsSimple());
            local.AddPostOptionsLine("Post-Options.");

            string help = local.ToString();

            Console.WriteLine(help);

            string[] lines = help.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            lines[0].Should().Be("Parameterless Constructor Test.");
            lines[1].Should().Be(string.Format(CultureInfo.InvariantCulture, "Copyright (C) {0} Author", year));
            lines[2].Should().Be("Pre-Options.");
            lines[4].Should().Be("  s, something    Input something here.");
            lines[6].Should().Be("Post-Options.");
        }
示例#25
0
        public void Long_pre_and_post_lines_without_spaces()
        {
            var local = new HelpText("Heading Info.");
            local.MaximumDisplayWidth = 40;
            local.AddPreOptionsLine("Before 0123456789012345678901234567890123456789012 After");
            local.AddOptions(new MockOptions());
            local.AddPostOptionsLine("Before 0123456789012345678901234567890123456789 After");

            string help = local.ToString();

            string[] lines = help.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            lines[1].Should().Be("Before ");
            lines[2].Should().Be("0123456789012345678901234567890123456789");
            lines[3].Should().Be("012 After");
            lines[lines.Length - 3].Should().Be("Before ");
            lines[lines.Length - 2].Should().Be("0123456789012345678901234567890123456789");
            lines[lines.Length - 1].Should().Be(" After");
        }
示例#26
0
        public string GetUsage()
        {
            var version = Assembly.GetExecutingAssembly().CustomAttributes.
                Single(attr => attr.AttributeType == typeof(AssemblyFileVersionAttribute)).
                ConstructorArguments[0].Value as string;

            var help = new HelpText
            {
                Heading = new HeadingInfo("XapReduce", version),
                Copyright = new CopyrightInfo(Res.Res.Author, 2013, 2014),
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

            help.AddPreOptionsLine("Thorarin.NET - http://thorarin.net/blog");
            help.AddPreOptionsLine("\r\nRemoves unneeded assemblies from a XAP file in modular Silverlight applications.\r\n");

            help.AddPreOptionsLine("Usage: XapReduce -i XapToShrink.xap -s PreviouslyLoadedXap.xap [...]");
            help.AddOptions(this);

            help.AddPostOptionsLine("This software is licensed under the MIT license.");

            return help;
        }
示例#27
0
        public void Customize_options_format()
        {
            var local = new HelpText("Customizing Test.");
            local.FormatOptionHelpText += new EventHandler<FormatOptionHelpTextEventArgs>(CustomizeOptionsFormat_FormatOptionHelpText);
            local.AddPreOptionsLine("Pre-Options.");
            local.AddOptions(new MockOptionsWithDescription());
            local.AddPostOptionsLine("Post-Options.");

            string help = local.ToString();

            Console.WriteLine(help);

            string[] lines = help.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            lines[0].Should().Be("Customizing Test.");
            lines[1].Should().Be("Pre-Options.");
            lines[3].Should().Be("  v, verbose       Kommentar umfassend Operationen.");
            lines[4].Should().Be("  i, input-file    Erforderlich. Gibt den Eingang an zu bearbeitenden Datei.");
            lines[6].Should().Be("Post-Options.");
        }
 /*
 public string FullText
 {
     get
     {
         if (string.IsNullOrEmpty(_fullText))
         {
             if (!string.IsNullOrEmpty(_line1))
             {
                 var builder = new StringBuilder(_line1);
                 builder.AppendLineIfNotNullOrEmpty(_line2);
                 builder.AppendLineIfNotNullOrEmpty(_line3);
                 builder.AppendLineIfNotNullOrEmpty(_line4);
                 builder.AppendLineIfNotNullOrEmpty(_line5);
                 _fullText = builder.ToString();
             }
         }
         return _fullText;
     }
 }
 */
 internal void AddToHelpText(HelpText helpText, bool before)
 {
     if (before)
     {
         if (!string.IsNullOrEmpty(_line1)) helpText.AddPreOptionsLine(_line1);
         if (!string.IsNullOrEmpty(_line2)) helpText.AddPreOptionsLine(_line2);
         if (!string.IsNullOrEmpty(_line3)) helpText.AddPreOptionsLine(_line3);
         if (!string.IsNullOrEmpty(_line4)) helpText.AddPreOptionsLine(_line4);
         if (!string.IsNullOrEmpty(_line5)) helpText.AddPreOptionsLine(_line5);
     }
     else
     {
         if (!string.IsNullOrEmpty(_line1)) helpText.AddPostOptionsLine(_line1);
         if (!string.IsNullOrEmpty(_line2)) helpText.AddPostOptionsLine(_line2);
         if (!string.IsNullOrEmpty(_line3)) helpText.AddPostOptionsLine(_line3);
         if (!string.IsNullOrEmpty(_line4)) helpText.AddPostOptionsLine(_line4);
         if (!string.IsNullOrEmpty(_line5)) helpText.AddPostOptionsLine(_line5);
     }
 }
示例#29
0
            public string GetUsage()
            {
                var help = new HelpText
                {
                    Heading = new HeadingInfo(Assembly.GetExecutingAssembly().GetName().Name, Assembly.GetExecutingAssembly().GetName().Version.ToString()),
                    Copyright = new CopyrightInfo("kripp.ch GmbH, Frank Werner-Krippendorf", 2013),
                    AdditionalNewLineAfterOption = true,
                    AddDashesToOption = true
                };

                help.AddPreOptionsLine(Environment.NewLine + "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + Environment.NewLine);
                help.AddPreOptionsLine("Usage: " + Assembly.GetExecutingAssembly().GetName().Name + " -c [COMMAND] (-m [MASK] -s -n)");
                help.AddPreOptionsLine("Available CommandOption (-c): ");
                help.AddPreOptionsLine(string.Empty);

                help.AddPreOptionsLine("mask parameter (-m): a string, containing the card's address (first card is 1) and the 8-bit binary state");
                help.AddPreOptionsLine("e.g. for adressing relay K6, relay K5 and relay K1, one byte is 49 (binary/8-bit mask =  '00110001').");
                help.AddPreOptionsLine("for read only commands like GETPORT the mask only needs to contain the address of the card.");
                help.AddPreOptionsLine(string.Empty);

                help.AddPostOptionsLine("Available values for the command option: ");
                help.AddPostOptionsLine(string.Empty);
                help.AddPostOptionsLine("-c SETPORT: Set ports by mask, requires address and 8-bit mask");
                help.AddPostOptionsLine(string.Empty);
                help.AddPostOptionsLine("-c GETPORT: Get ports for address, requires address in mask parameter");
                help.AddPostOptionsLine(string.Empty);
                help.AddPostOptionsLine("-c SETSINGLE: Switch on relay without changing the other outputs, requires address and 8-bit mask");
                help.AddPostOptionsLine(string.Empty);
                help.AddPostOptionsLine("-c DELSINGLE: Switch off relay without changing the other outputs, requires address and 8-bit mask");
                help.AddPostOptionsLine(string.Empty);
                help.AddPostOptionsLine("-c TOGGLE: Changing the switching status without changing the remaining outputs, requires address and 8-bit mask");
                help.AddPostOptionsLine(string.Empty);

                help.AddPostOptionsLine("-c HARDWARETEST: Switches all relays one-by-one, requires address in mask parameter");

                help.AddPostOptionsLine(string.Empty);

                help.AddOptions(this);

                return help;
            }
示例#30
0
 internal HelpText AddToHelpText(HelpText helpText, bool before)
 {
     // before flag only distinguishes which action is called,
     // so refactor common code and call with appropriate func
     return before
         ? this.AddToHelpText(helpText, line => helpText.AddPreOptionsLine(line))
         : this.AddToHelpText(helpText, line => helpText.AddPostOptionsLine(line));
 }
 public string GetUsage()
 {
     var helpText = new HelpText { AddDashesToOption = true };
     HelpText.DefaultParsingErrorsHandler(this, helpText);
     helpText.AddPreOptionsLine($"Usage: {App.ExeName} -i <input file mask> [-o <output directory>] [--lib <lib name>] [--inkscape <inkscape app path>] [--fix-fill-type] [--no-update-check]");
     helpText.AddOptions(this);
     helpText.AddPostOptionsLine(GetGithub());
     return helpText;
 }
示例#32
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));
        }