本文整理汇总了Java中jargs.gnu.CmdLineParser.IllegalOptionValueException方法的典型用法代码示例。如果您正苦于以下问题:Java CmdLineParser.IllegalOptionValueException方法的具体用法?Java CmdLineParser.IllegalOptionValueException怎么用?Java CmdLineParser.IllegalOptionValueException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jargs.gnu.CmdLineParser
的用法示例。
在下文中一共展示了CmdLineParser.IllegalOptionValueException方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseValue
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
protected Object parseValue( String arg, Locale locale )
throws CmdLineParser.IllegalOptionValueException {
try {
DateFormat dateFormat =
DateFormat.getDateInstance(DateFormat.SHORT, locale);
return dateFormat.parse(arg);
}
catch (ParseException e) {
throw new CmdLineParser.IllegalOptionValueException(this, arg);
}
}
示例2: testBadFormat
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
public void testBadFormat() throws Exception {
CmdLineParser parser = new CmdLineParser();
CmdLineParser.Option size = parser.addIntegerOption('s', "size");
try {
parser.parse(new String[] { "--size=blah" });
fail("Expected IllegalOptionValueException");
} catch (CmdLineParser.IllegalOptionValueException e) {
// pass
}
}
示例3: testMissingValueForStringOption
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
public void testMissingValueForStringOption() throws Exception {
CmdLineParser parser = new CmdLineParser();
parser.addBooleanOption('v', "verbose");
parser.addStringOption('c', "config");
try {
parser.parse(new String[] {"-v", "-c"});
fail();
} catch (CmdLineParser.IllegalOptionValueException e) {
}
}
示例4: testIllegalCustomOption
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
public void testIllegalCustomOption() throws Exception {
CmdLineParser parser = new CmdLineParser();
CmdLineParser.Option date =
parser.addOption(new ShortDateOption('d', "date"));
try {
parser.parse(new String[]{"-d", "foobar"}, Locale.US);
fail("Expected IllegalOptionValueException");
}
catch (CmdLineParser.IllegalOptionValueException e) {
//pass
}
}
示例5: main
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
public static void main(String[] argv) throws CmdLineParser.UnknownOptionException, CmdLineParser.IllegalOptionValueException {
Globals.setHeadless(true);
if (argv.length == 0 || argv[0].equals("-h") || argv[0].equals("--help") || argv[0].equals("-V") || argv[0].equals("--version")) {
CLTFactory.generalUsage();
System.exit(0);
}
String cmdName = argv[0].toLowerCase();
CmdLineParser parser = new CommandLineParser();
if (CommandLineParserForJuicer.isJuicerCommand(cmdName)) {
parser = new CommandLineParserForJuicer();
HiCGlobals.useCache = false; //TODO until memory leak cleared
}
boolean help;
boolean version;
parser.parse(argv);
if (CommandLineParserForJuicer.isJuicerCommand(cmdName)) {
HiCGlobals.printVerboseComments = ((CommandLineParserForJuicer)parser).getVerboseOption();
HiCGlobals.isLegacyOutputPrintingEnabled = ((CommandLineParserForJuicer) parser).getLegacyOutputOption();
help = ((CommandLineParserForJuicer)parser).getHelpOption();
version = ((CommandLineParserForJuicer)parser).getVersionOption();
}
else {
HiCGlobals.printVerboseComments = ((CommandLineParser)parser).getVerboseOption();
help = ((CommandLineParser)parser).getHelpOption();
version = ((CommandLineParser)parser).getVersionOption();
if (((CommandLineParser)parser).getAllPearsonsOption()) {
HiCGlobals.MAX_PEARSON_ZOOM = 1;
}
}
String[] args = parser.getRemainingArgs();
JuiceboxCLT instanceOfCLT;
String cmd = "";
if (args.length == 0) {
instanceOfCLT = null;
} else {
cmd = args[0];
instanceOfCLT = CLTFactory.getCLTCommand(cmd);
}
if (instanceOfCLT != null) {
if (version) {
System.out.println("Juicer tools version " + HiCGlobals.versionNum);
}
if (args.length == 1 || help) {
instanceOfCLT.printUsageAndExit();
}
instanceOfCLT.readArguments(args, parser);
instanceOfCLT.run();
} else {
throw new RuntimeException("Unknown command: " + cmd);
}
}
示例6: main
import jargs.gnu.CmdLineParser; //导入方法依赖的package包/类
public static void main(String[] argv) throws IOException, CmdLineParser.UnknownOptionException, CmdLineParser.IllegalOptionValueException {
String hicFilePaths="/Users/nathanielmusial/CS_Projects/SMART_Projects/Testing_Files/HiC/gm12878_intra_nofrag_30.hic";//.Hic
String PeaksFile="/Users/nathanielmusial/CS_Projects/SMART_Projects/Testing_Files/Other/GM12878_loop_list.txt";//.txt
String SaveFolderPath="/Users/nathanielmusial/CS_Projects/SMART_Projects/Output";
/*
APAvsDistance test= new APAvsDistance();
test.run();
*/
String seqPath = "/Users/muhammadsaadshamim/Desktop/FractalArt/Time_Sequence";
String newPath = "/Users/muhammadsaadshamim/Desktop/FractalArt/temp_sim_merged_nodups.txt";
//writeMergedNoDupsFromTimeSeq(seqPath, newPath);
String[] ll51231123 = {"pre", "-r", "1000,500,100,50,10",
newPath,
"/Users/muhammadsaadshamim/Desktop/FractalArt/sim.hic",
"/Users/muhammadsaadshamim/Desktop/FractalArt/art.chrom.sizes"};
HiCTools.main(ll51231123);
/*
String[] ll51231123 = {"motifs",
"hg19",
"/Users/muhammadsaadshamim/Desktop/test_motifs/gm12878_2",
"/Users/muhammadsaadshamim/Desktop/test_motifs/loops_clean.txt"};
HiCTools.main(ll51231123);
*/
}