public string GetUsage() { Version version = Assembly.GetExecutingAssembly().GetName().Version; var heading = new HeadingInfo(ApplicationName, version.Major + "." + version.Minor); var help = new HelpText(heading); help.Copyright = new CopyrightInfo(true, "Lars Corneliussen, Faktum Software GmbH", 2010); help.AddOptions(this); return help; }
public void Program_name_and_version() { var hi = new HeadingInfo("myecho", "2.5"); string s = hi; s.Should().Be("myecho 2.5"); var sw = new StringWriter(); hi.WriteMessage("hello unit-test", sw); sw.ToString().Should().Be("myecho: hello unit-test" + Environment.NewLine); }
public void Only_program_name() { var hi = new HeadingInfo("myprog"); string s = hi; s.Should().Be("myprog"); var sw = new StringWriter(); hi.WriteMessage("a message", sw); sw.ToString().Should().Be("myprog: a message" + Environment.NewLine); }
public string GetUsage() { //ヘッダーの設定 HeadingInfo head = new HeadingInfo("CreateYoutubeQRCode", "Version 0.1"); HelpText help = new HelpText(head); help.Copyright = new CopyrightInfo("KAJIWARA Yutaka", 2015); //全オプションを表示(1行間隔) help.AdditionalNewLineAfterOption = true; help.AddOptions(this); return help.ToString(); }
public string GetUsage() { var versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); // AssemblyCopyrightAttribute asmcpy = (AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute)); //ヘッダーの設定 HeadingInfo head = new HeadingInfo(versionInfo.ProductName, "Version " + versionInfo.ProductVersion); HelpText help = new HelpText(head); help.Copyright = new CopyrightInfo("T. Minemoto", 2010); help.AddPreOptionsLine("University of Hyogo, Research Group of Fundamental Computer Engineering"); help.AddPreOptionsLine("Usage: MorphExtractroCL.exe -i D:\\input -o out -b 123"); //全オプションを表示(1行間隔) help.AdditionalNewLineAfterOption = false; help.AddOptions(this); return help.ToString(); }
public string GetUsage() { var programName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; HeadingInfo _headingInfo = new HeadingInfo(programName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); var help = new HelpText(_headingInfo); help.AdditionalNewLineAfterOption = true; help.Copyright = new CopyrightInfo("Modulo Security Solutions", 2011, 2011); help.AddPreOptionsLine("This is free software. You may redistribute copies of it under the terms of"); help.AddPreOptionsLine("the License <https://github.com/modulogrc/modSIC/blob/master/README>."); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format("Usage: {0} -c -m <server> -u <username> -p <password> -t <target> -y <target-username> -z <target-password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} --collect --modsic <server> --username <username> --password <password> --target <target> --target-username <target-username> --target-password <target-password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} -s -m <server> -u <username> -p <password> -t <target> -y <target-username> -z <target-password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} --collect-sync --modsic <server> --username <username> --password <password> --target <target> --target-username <target-username> --target-password <target-password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} -g <id> -m <server> -u <username> -p <password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} --get-results <id> --modsic <server> --username <username> --password <password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} -x <id> -m <server> -u <username> -p <password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} --cancel <id> --modsic <server> --username <username> --password <password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} -l -m <server> -u <username> -p <password>", programName)); help.AddPreOptionsLine(""); help.AddPreOptionsLine(String.Format(" {0} --list --modsic <server> --username <username> --password <password>", programName)); help.AddOptions(this); return help; }
public Options(HeadingInfo headingInfo) { _headingInfo = headingInfo; }