当前位置: 首页>>代码示例>>Java>>正文


Java Switch.setHelp方法代码示例

本文整理汇总了Java中com.martiansoftware.jsap.Switch.setHelp方法的典型用法代码示例。如果您正苦于以下问题:Java Switch.setHelp方法的具体用法?Java Switch.setHelp怎么用?Java Switch.setHelp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.martiansoftware.jsap.Switch的用法示例。


在下文中一共展示了Switch.setHelp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initJSAP

import com.martiansoftware.jsap.Switch; //导入方法依赖的package包/类
private static void initJSAP() throws JSAPException {
jsap = new JSAP();
    	
  	FlaggedOption opt1 = new FlaggedOption(ARG_UT2004_HOME_DIR_LONG)
      	.setStringParser(JSAP.STRING_PARSER)
      	.setRequired(true) 
      	.setShortFlag(ARG_UT2004_HOME_DIR_SHORT)
      	.setLongFlag(ARG_UT2004_HOME_DIR_LONG);    
      opt1.setHelp("UT2004 home directory containing maps (within Maps folder).");
      
      jsap.registerParameter(opt1);
      
      FlaggedOption opt2 = new FlaggedOption(ARG_MAPS_LONG)
   	.setStringParser(JSAP.STRING_PARSER)
   	.setRequired(false) 
   	.setShortFlag(ARG_MAPS_SHORT)
   	.setLongFlag(ARG_MAPS_LONG);    
   opt2.setHelp("Semicolon separated list of maps for which navmeshes should be generated, e.g.: DM-Flux2;DM-1on1-Trite");
   
   jsap.registerParameter(opt2);
   
   Switch opt3 = new Switch(ARG_ALL_LONG)
	.setShortFlag(ARG_ALL_SHORT)
	.setLongFlag(ARG_ALL_LONG);    
opt3.setHelp("Create navmeshes for all maps (*.ut2) from Maps directory.");
	
   jsap.registerParameter(opt3);
   
   FlaggedOption opt4 = new FlaggedOption(ARG_OUTPUT_LONG)
   	.setStringParser(JSAP.STRING_PARSER)
   	.setRequired(false) 
   	.setShortFlag(ARG_OUTPUT_SHORT)
   	.setLongFlag(ARG_OUTPUT_LONG)
   	.setDefault("./output");    
   opt4.setHelp("Target directory where to output navmeshes and other files.");
   
   jsap.registerParameter(opt4);
   
   Switch opt5 = new Switch(ARG_REWRITE_LONG)
	.setShortFlag(ARG_REWRITE_SHORT)
	.setLongFlag(ARG_REWRITE_LONG);    
   opt5.setHelp("Rewrite any existing files when outputting navmesh(es).");
   
   jsap.registerParameter(opt5);
   
   Switch opt6 = new Switch(ARG_CONTINUE_LONG)
	.setShortFlag(ARG_CONTINUE_SHORT)
	.setLongFlag(ARG_CONTINUE_LONG);    
   opt6.setHelp("Do not rewrite any existing files, take them as inputs (e.g. continue the job / create missing files) if possible. ");
  
  	jsap.registerParameter(opt6);
 	}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:53,代码来源:Main.java

示例2: cfgJSAP

import com.martiansoftware.jsap.Switch; //导入方法依赖的package包/类
private static void cfgJSAP() throws JSAPException {
	// Assists with capturing command-line parameters and constructing usage
	jsap = new JSAP();

	// top design flag and source file
	FlaggedOption optTopFileName = new FlaggedOption("topFileName");
	optTopFileName.setStringParser(JSAP.STRING_PARSER);
	optTopFileName.setShortFlag('t');
	optTopFileName.setLongFlag("top");
	optTopFileName.setHelp("PHDL top level design file name.");
	jsap.registerParameter(optTopFileName);

	// directory containing phdl source files
	FlaggedOption optDirectory = new FlaggedOption("directory");
	optDirectory.setStringParser(JSAP.STRING_PARSER);
	optDirectory.setShortFlag('d');
	optDirectory.setLongFlag("dir");
	optDirectory.setHelp("Directory where phdl source files are located");
	jsap.registerParameter(optDirectory);

	// source files
	UnflaggedOption optFileName = new UnflaggedOption("fileName");
	optFileName.setStringParser(JSAP.STRING_PARSER);
	optFileName.setGreedy(true);
	optFileName.setHelp("PHDL source file name.");
	jsap.registerParameter(optFileName);

	// verbose flag
	Switch swVerbose = new Switch("verbose");
	swVerbose.setShortFlag('v');
	swVerbose.setLongFlag("verbose");
	swVerbose.setHelp("Requests verbose output.");
	jsap.registerParameter(swVerbose);

	// generate hierarcy DOT and PNG output flag
	Switch swDOT = new Switch("png");
	swDOT.setShortFlag('p');
	swDOT.setLongFlag("png");
	swDOT.setHelp("Exports hierarchy PNG pictures using DOT in the /png folder.");
	jsap.registerParameter(swDOT);

	// suppress warnings flag
	Switch swSuppress = new Switch("suppress");
	swSuppress.setShortFlag('s');
	swSuppress.setLongFlag("suppress");
	swSuppress.setHelp("Suppress all warnings from the compiler.");
	jsap.registerParameter(swSuppress);

	// report design hierarchy on the command line flag
	Switch swReport = new Switch("report");
	swReport.setShortFlag('r');
	swReport.setLongFlag("report");
	swReport.setHelp("Report design hierarchy at the command line. (Extremely verbose)");
	jsap.registerParameter(swReport);

	// clean flag (remove all generated files and folders)
	Switch swClean = new Switch("clean");
	swClean.setShortFlag('c');
	swClean.setLongFlag("clean");
	swClean.setHelp("Clean (remove) all generated files and folders.");
	jsap.registerParameter(swClean);

	// generate AST output from parser (for debug only)
	Switch swAST = new Switch("ast");
	swAST.setShortFlag('a');
	swAST.setLongFlag("ast");
	swAST.setHelp("Generates a DOT graphical ast of all source files in the /ast folder.");
	jsap.registerParameter(swAST);

	// help
	Switch swHelp = new Switch("help");
	swHelp.setShortFlag('h');
	swHelp.setLongFlag("help");
	swHelp.setHelp("Display this usage help.");
	jsap.registerParameter(swHelp);
}
 
开发者ID:timofonic,项目名称:PHDL,代码行数:77,代码来源:Compile.java


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