394 String key = option.substring(2, (sepIndex != -1 ? sepIndex : argLength) ); |
394 String key = option.substring(2, (sepIndex != -1 ? sepIndex : argLength) ); |
395 if (!JavacProcessingEnvironment.isValidOptionName(key)) { |
395 if (!JavacProcessingEnvironment.isValidOptionName(key)) { |
396 throw helper.newInvalidValueException("err.invalid.A.key", option); |
396 throw helper.newInvalidValueException("err.invalid.A.key", option); |
397 } |
397 } |
398 helper.put(option, option); |
398 helper.put(option, option); |
|
399 } |
|
400 }, |
|
401 |
|
402 DEFAULT_MODULE_FOR_CREATED_FILES("--default-module-for-created-files", |
|
403 "opt.arg.default.module.for.created.files", |
|
404 "opt.default.module.for.created.files", EXTENDED, BASIC) { |
|
405 @Override |
|
406 public void process(OptionHelper helper, String option, String arg) throws InvalidValueException { |
|
407 String prev = helper.get(DEFAULT_MODULE_FOR_CREATED_FILES); |
|
408 if (prev != null) { |
|
409 throw helper.newInvalidValueException("err.option.too.many", |
|
410 DEFAULT_MODULE_FOR_CREATED_FILES.primaryName); |
|
411 } else if (arg.isEmpty()) { |
|
412 throw helper.newInvalidValueException("err.no.value.for.option", option); |
|
413 } else if (getPattern().matcher(arg).matches()) { |
|
414 helper.put(DEFAULT_MODULE_FOR_CREATED_FILES.primaryName, arg); |
|
415 } else { |
|
416 throw helper.newInvalidValueException("err.bad.value.for.option", option, arg); |
|
417 } |
|
418 } |
|
419 |
|
420 @Override |
|
421 public Pattern getPattern() { |
|
422 return Pattern.compile("[^,].*"); |
399 } |
423 } |
400 }, |
424 }, |
401 |
425 |
402 X("--help-extra -X", "opt.X", STANDARD, INFO) { |
426 X("--help-extra -X", "opt.X", STANDARD, INFO) { |
403 @Override |
427 @Override |