RemoveSettingKeyStoreCommand() { super("Remove a setting from the keystore"); arguments = parser.nonOptions("setting names"); }
.nonOptions("Service-specific options that will be passed to the underlying service.");
AddFileKeyStoreCommand() { super("Add a file setting to the keystore"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); // jopt simple has issue with multiple non options, so we just get one set of them here // and convert to File when necessary // see https://github.com/jopt-simple/jopt-simple/issues/103 this.arguments = parser.nonOptions("setting [filepath]"); }
AddStringKeyStoreCommand() { super("Add a string setting to the keystore"); this.stdinOption = parser.acceptsAll(Arrays.asList("x", "stdin"), "Read setting value from stdin"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); this.arguments = parser.nonOptions("setting name"); }
RemoveSettingKeyStoreCommand() { super("Remove a setting from the keystore"); arguments = parser.nonOptions("setting names"); }
RemoveSettingKeyStoreCommand() { super("Remove a setting from the keystore"); arguments = parser.nonOptions("setting names"); }
RemoveSettingKeyStoreCommand() { super("Remove a setting from the keystore"); arguments = parser.nonOptions("setting names"); }
AddFileKeyStoreCommand() { super("Add a file setting to the keystore"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); // jopt simple has issue with multiple non options, so we just get one set of them here // and convert to File when necessary // see https://github.com/jopt-simple/jopt-simple/issues/103 this.arguments = parser.nonOptions("setting [filepath]"); }
AddFileKeyStoreCommand() { super("Add a file setting to the keystore"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); // jopt simple has issue with multiple non options, so we just get one set of them here // and convert to File when necessary // see https://github.com/jopt-simple/jopt-simple/issues/103 this.arguments = parser.nonOptions("setting [filepath]"); }
AddFileKeyStoreCommand() { super("Add a file setting to the keystore"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); // jopt simple has issue with multiple non options, so we just get one set of them here // and convert to File when necessary // see https://github.com/jopt-simple/jopt-simple/issues/103 this.arguments = parser.nonOptions("setting [filepath]"); }
private static NonOptionArgumentSpec<URI> makeBaseUriSpec(OptionParser optionParser) { return optionParser.nonOptions(CommandDescription.DESCRIPTION_BASE_URI).ofType(URI.class); }
private static NonOptionArgumentSpec<URI> makeBaseUriSpec(OptionParser optionParser) { return optionParser.nonOptions(CommandDescription.DESCRIPTION_BASE_URI).ofType(URI.class); }
AddStringKeyStoreCommand() { super("Add a string setting to the keystore"); this.stdinOption = parser.acceptsAll(Arrays.asList("x", "stdin"), "Read setting value from stdin"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); this.arguments = parser.nonOptions("setting name"); }
AddStringKeyStoreCommand() { super("Add a string setting to the keystore"); this.stdinOption = parser.acceptsAll(Arrays.asList("x", "stdin"), "Read setting value from stdin"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); this.arguments = parser.nonOptions("setting name"); }
AddStringKeyStoreCommand() { super("Add a string setting to the keystore"); this.stdinOption = parser.acceptsAll(Arrays.asList("x", "stdin"), "Read setting value from stdin"); this.forceOption = parser.acceptsAll(Arrays.asList("f", "force"), "Overwrite existing setting without prompting"); this.arguments = parser.nonOptions("setting name"); }
/** * * @param line */ public ExecJavaCliParser(String line){ this.optionParser = new OptionParser("D:X:"); this.optionParser.allowsUnrecognizedOptions(); this.xVmOptions = this.optionParser.accepts("X").withRequiredArg(); this.sysPropOptions = this.optionParser.accepts("D").withRequiredArg(); this.mainArgumentsOptions = this.optionParser.nonOptions(); this.optionSet = this.optionParser.parse(line.split(" ")); Pattern p = Pattern.compile("([\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*"); this.mainArguments = new ArrayList<String>(this.mainArgumentsOptions.values(this.optionSet)); Iterator<String> mainArgumentsIter = this.mainArguments.iterator(); boolean mainFound = false; while (mainArgumentsIter.hasNext()){ String value = mainArgumentsIter.next(); Matcher m = p.matcher(value); boolean matches = m.matches(); if (matches && !mainFound){ mainFound = true; this.main = value; mainArgumentsIter.remove(); break; } else if (!mainFound){ mainArgumentsIter.remove(); } } }
public CommonOptions(OptionParser parser){ help = parser.acceptsAll(asList("h", "?", "help"), "Show help").forHelp(); readWriteOption = parser.accepts("read-write", "Connect to repository in read-write mode"); metrics = parser.accepts("metrics", "Enables metrics based statistics collection"); segment = parser.accepts("segment", "Use older oak-segment support"); nonOption = parser.nonOptions(DEFAULT_CONNECTION_STRING); }
public CommonOptions(OptionParser parser){ help = parser.acceptsAll(asList("h", "?", "help"), "Show help").forHelp(); readWriteOption = parser.accepts("read-write", "Connect to repository in read-write mode"); metrics = parser.accepts("metrics", "Enables metrics based statistics collection"); segment = parser.accepts("segment", "Use older oak-segment support"); nonOption = parser.nonOptions(DEFAULT_CONNECTION_STRING); }
.nonOptions("Base predefined CSV format, one of " + predefinedFormats.values());
void processArguments(Environment env, Consumer<OptionParser> parserConsumer, BiConsumer<OptionSet, BiFunction<String, OptionSet, ITransformationService.OptionResult>> resultConsumer) { final OptionParser parser = new OptionParser(); parser.allowsUnrecognizedOptions(); profileOption = parser.accepts("version", "The version we launched with").withRequiredArg(); gameDirOption = parser.accepts("gameDir", "Alternative game directory").withRequiredArg().withValuesConvertedBy(new PathConverter(PathProperties.DIRECTORY_EXISTING)); assetsDirOption = parser.accepts("assetsDir", "Assets directory").withRequiredArg().withValuesConvertedBy(new PathConverter(PathProperties.DIRECTORY_EXISTING)); minecraftJarOption = parser.accepts("minecraftJar", "Path to minecraft jar").withRequiredArg().withValuesConvertedBy(new PathConverter(PathProperties.READABLE)).withValuesSeparatedBy(','); launchTarget = parser.accepts("launchTarget", "LauncherService target to launch").withRequiredArg(); parserConsumer.accept(parser); nonOption = parser.nonOptions(); this.optionSet = parser.parse(this.args); env.computePropertyIfAbsent(IEnvironment.Keys.VERSION.get(), s -> this.optionSet.valueOf(profileOption)); env.computePropertyIfAbsent(IEnvironment.Keys.GAMEDIR.get(), f -> this.optionSet.valueOf(gameDirOption)); env.computePropertyIfAbsent(IEnvironment.Keys.ASSETSDIR.get(), f -> this.optionSet.valueOf(assetsDirOption)); env.computePropertyIfAbsent(IEnvironment.Keys.LAUNCHTARGET.get(), f -> this.optionSet.valueOf(launchTarget)); resultConsumer.accept(this.optionSet, this::optionResults); }