• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Text.HelpText类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CommandLine.Text.HelpText的典型用法代码示例。如果您正苦于以下问题:C# HelpText类的具体用法?C# HelpText怎么用?C# HelpText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HelpText类属于CommandLine.Text命名空间,在下文中一共展示了HelpText类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetUsage

 public string GetUsage()
 {
   var help = new HelpText("Machine Javascript Bundler");
   help.AddPreOptionsLine(@"Example: jsbundler -b path\to\scripts path\to\scripts\folder1 path\to\scripts\folder2 \path\to\scripts\folder3");
   help.AddOptions(this);
   return help;
 }
开发者ID:machine,项目名称:machine.javascript,代码行数:7,代码来源:Options.cs


示例2: Main

        private static void Main(string[] args)
        {
            try
            {
                var options = new Options();
                if (!Parser.Default.ParseArguments(args, options))
                {
                    var helpText = new HelpText("Laan SolutionConverter", Assembly.GetEntryAssembly().GetName().Version.ToString());

                    helpText.AddOptions(options);
                    Console.WriteLine(helpText.ToString());
                    return;
                }

                switch (options.Mode)
                {
                    case Mode.Xml:
                        ConvertToXml(options);
                        break;

                    case Mode.Sln:
                        ConvertToSln(options);
                        break;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
开发者ID:PlutoCYF,项目名称:slnconverter,代码行数:30,代码来源:Program.cs


示例3: GetUsage

 public string GetUsage()
 {
   HelpText help = new HelpText(@"Machine.Migrations");
   help.Copyright = new CopyrightInfo("Machine Project", 2007, 2008, 2009);
   help.AddOptions(this);
   return help;
 }
开发者ID:emmekappa,项目名称:machine.migrations,代码行数:7,代码来源:Options.cs


示例4: GetUsage

 public string GetUsage()
 {
     var help = new HelpText(desc);
     help.AdditionalNewLineAfterOption = true;
     help.AddOptions(this);
     return help;
 }
开发者ID:cental,项目名称:PatternSim,代码行数:7,代码来源:Command2.cs


示例5: GetUsage

        public string GetUsage()
        {
            var help = new HelpText
            {
                Heading = new HeadingInfo("CqlSharp.Performance.Client", "0.1.0"),
                Copyright = new CopyrightInfo("Joost Reuzel", 2014),
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

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

                if(!string.IsNullOrEmpty(errors))
                {
                    help.AddPreOptionsLine(string.Concat(Environment.NewLine, "ERROR(S):"));
                    help.AddPreOptionsLine(errors);
                }
            }

            help.AddPreOptionsLine("Usage: Client -c 100 -r 10000");
            help.AddOptions(this);
            return help;
        }
开发者ID:reuzel,项目名称:CqlSharp,代码行数:25,代码来源:Options.cs


示例6: GetUsage

        public string GetUsage()
        {
            var help = new HelpText
            {
                Heading = new HeadingInfo("#b#Versionr## #q#- the less hateful version control system.##"),
                AddDashesToOption = true,
            };
            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(string.Format("\nUsage:\n   {0}\n", Usage));
            help.AddPreOptionsLine(string.Format("##The `#b#{0}##` Command:", Verb));
            foreach (var x in Description)
                help.AddPreOptionsLine("  " + x);
            help.AddPreOptionsLine("\n##Options:#b#");
            help.AddOptions(this);
            return help;
        }
开发者ID:eatplayhate,项目名称:versionr,代码行数:28,代码来源:VerbOptionsBase.cs


示例7: GetUsage

        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));
        }
开发者ID:MasterDevs,项目名称:TidyJson,代码行数:32,代码来源:Options.cs


示例8: GetUsage

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

            var help = new HelpText
            {
                AdditionalNewLineAfterOption = false,
                AddDashesToOption = true,
                Copyright = new CopyrightInfo("Geoffrey Huntley <[email protected]>", 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;
        }
开发者ID:stevegore,项目名称:atlassian-cloud-backup,代码行数:32,代码来源:CommandLineOptions.cs


示例9: GetUsage

        public string GetUsage()
        {
            var name = Assembly.GetExecutingAssembly().GetName();
            var help = new HelpText
            {
                Heading = new HeadingInfo(name.Name, name.Version.ToString()),
                Copyright = new CopyrightInfo("me!", 2015),
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

            if (LastParserState.Errors.Any())
            {
                var errors = help.RenderParsingErrorsText(this, 2);
                if (!string.IsNullOrEmpty(errors))
                {
                    help.AddPreOptionsLine(string.Concat(Environment.NewLine, "ERROR(S):"));
                    help.AddPreOptionsLine(errors);
                }
            }

            help.AddPreOptionsLine("Usage: RunMongoRun [options]");
            help.AddOptions(this);
            return help;
        }
开发者ID:baronfel,项目名称:runmongorun,代码行数:25,代码来源:Program.cs


示例10: GetUsage

        public string GetUsage(string verb)
        {
            var help = new HelpText
            {
                Heading = HeadingInfo.Default,
                Copyright = CopyrightInfo.Default,
                AdditionalNewLineAfterOption = true,
                AddDashesToOption = true
            };

            object optionsObject = null;
            if (verb == DotNetCommandName)
            {
                help.AddPreOptionsLine(Environment.NewLine + "Usage: ToTypeScriptD dotnet [--specialTypes] [File1.dll]...[FileN.dll]");
                optionsObject = new DotNetSubOptions();
            }
            else if (verb == WinmdCommandName)
            {
                help.AddPreOptionsLine(Environment.NewLine + "Usage: ToTypeScriptD winmd [--specialTypes] [File1.winmd]...[FileN.winmd]");
                optionsObject = new WinmdSubOptions();
            }

            if (optionsObject != null)
            {
                help.AddOptions(optionsObject); ;
            }
            else
            {
                help.AddDashesToOption = false;
                help.AddOptions(this);
            }

            return help;
        }
开发者ID:sumitkm,项目名称:ToTypeScriptD,代码行数:34,代码来源:Options.cs


示例11: GetUsage

        public string GetUsage()
        {
            var help = new HelpText(new HeadingInfo("BottomShelf Host", Assembly.GetExecutingAssembly().GetName().Version.ToString(2)));
            help.Copyright = new CopyrightInfo("Peasant Coder Foundation", DateTime.Now.Year);
            help.AddOptions(this);

            return help.ToString();
        }
开发者ID:tyronegroves,项目名称:BottomShelf,代码行数:8,代码来源:CommandLineParameters.cs


示例12: GetUsage

		public string GetUsage() {
			HelpText help = new HelpText(eMailServer.HeadingInfo);
			help.AdditionalNewLineAfterOption = true;
			help.Copyright = new CopyrightInfo("Ringo Leese", 2013, 2013);
			help.AddOptions(this);
				
			return help;
		}
开发者ID:CodeFork,项目名称:eMailServer.NET,代码行数:8,代码来源:Options.cs


示例13: GetUsage

		public string GetUsage() {
			HelpText help = new HelpText();
			help.AdditionalNewLineAfterOption = true;
			//help.Copyright = new CopyrightInfo("locrmap", 2009, 2012);
			help.AddOptions(this);
			
			return help;
		}
开发者ID:ringostarr80,项目名称:WebDav.NET,代码行数:8,代码来源:Options.cs


示例14: GetUsage

		public string GetUsage()
		{
			var help = new HelpText { AdditionalNewLineAfterOption = true };
			var execName = Assembly.GetExecutingAssembly().GetName().Name + ".exe";
			help.AddPreOptionsLine(string.Format("Usage: {0} -c {{command}} -a http://admin:[email protected]:5984/yourdb [-d .\\designDocuments] [-u user1 -p passw0rd]", execName));
			help.AddOptions(this);
			return help;
		}
开发者ID:artikh,项目名称:CouchDude.SchemeManager,代码行数:8,代码来源:Options.cs


示例15: GetHeader

 public HelpText GetHeader()
 {
     HelpText header = new HelpText(Properties.Resources.RadegastTitle);
     header.AdditionalNewLineAfterOption = true;
     header.Copyright = new CopyrightInfo("Radegast Development Team", 2009, 2011);
     header.AddPreOptionsLine("http://radegast.org/");
     return header;
 }
开发者ID:BillBarnhill,项目名称:Radegast-Viewer,代码行数:8,代码来源:Program.cs


示例16: HandleParsingErrorsInHelp

 private void HandleParsingErrorsInHelp(HelpText help)
 {
     string errors = help.RenderParsingErrorsText(this);
     if (!string.IsNullOrEmpty(errors))
     {
         help.AddPreOptionsLine(string.Concat(Environment.NewLine, "ERROR: ", errors, Environment.NewLine));
     }
 }
开发者ID:chitza,项目名称:XmlMerge,代码行数:8,代码来源:Options.cs


示例17: GetUsage

 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;
 }
开发者ID:palominolabs,项目名称:windows_s3_uploader,代码行数:9,代码来源:Program.cs


示例18: GetUsage

        public string GetUsage()
        {
            HelpText text = new HelpText(" ");

            text.AddPreOptionsLine("  Usage: SlimNet.ConsoleHost.exe -p14000 -a\"C:\\path\\to\\assemblies\\\"");
            text.AddOptions(this);

            return text.ToString();
        }
开发者ID:corefan,项目名称:SlimNet,代码行数:9,代码来源:CommandLineOptions.cs


示例19: create_helptext

 public HelpText create_helptext(string heading_info)
 {
     var help = new HelpText(heading_info)
     {
         AdditionalNewLineAfterOption = true,
         Copyright = new CopyrightInfo("beta-1.cn/nsnail([email protected])", 2012)
     };
     return help;
 }
开发者ID:kakayou,项目名称:spidernet,代码行数:9,代码来源:cmd_opt.cs


示例20: GetHelp

 public string GetHelp()
 {
     var help = new HelpText("  Benutzung: xpatch xmlDatei xpath-Ausdruck [neuerwert] [parameter]"
                             + "\n\nWird kein neuer Wert angegeben, fordert xpatch zur "
                             + "Eingabe des gewünschten Wertes auf."
                             + "\n\nWeitere Parameter:");
     help.AddOptions(this);
     return help;
 }
开发者ID:lcorneliussen,项目名称:xpatch,代码行数:9,代码来源:XPatchOptions.cs



注:本文中的CommandLine.Text.HelpText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommandMessenger.ReceivedCommand类代码示例发布时间:2022-05-24
下一篇:
C# Mocks.SimpleOptionsWithArray类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap