Tabnine Logo
CommandLine$Model$ParserSpec.posixClusteredShortOptionsAllowed
Code IndexAdd Tabnine to your IDE (free)

How to use
posixClusteredShortOptionsAllowed
method
in
picocli.CommandLine$Model$ParserSpec

Best Java code snippets using picocli.CommandLine$Model$ParserSpec.posixClusteredShortOptionsAllowed (Showing top 13 results out of 315)

origin: remkop/picocli

private void printParser(ParserSpec parser, PrintWriter pw, String indent) {
  pw.printf("%sParserSpec:%n", indent);
  indent += "  ";
  pw.printf("%sseparator: '%s'%n", indent, parser.separator());
  pw.printf("%sendOfOptionsDelimiter: '%s'%n", indent, parser.endOfOptionsDelimiter());
  pw.printf("%sexpandAtFiles: %s%n", indent, parser.expandAtFiles());
  pw.printf("%satFileCommentChar: '%s'%n", indent, parser.atFileCommentChar());
  pw.printf("%soverwrittenOptionsAllowed: %s%n", indent, parser.overwrittenOptionsAllowed());
  pw.printf("%sunmatchedArgumentsAllowed: %s%n", indent, parser.unmatchedArgumentsAllowed());
  pw.printf("%sunmatchedOptionsArePositionalParams: %s%n", indent, parser.unmatchedOptionsArePositionalParams());
  pw.printf("%sstopAtUnmatched: %s%n", indent, parser.stopAtUnmatched());
  pw.printf("%sstopAtPositional: %s%n", indent, parser.stopAtPositional());
  pw.printf("%sposixClusteredShortOptionsAllowed: %s%n", indent, parser.posixClusteredShortOptionsAllowed());
  pw.printf("%saritySatisfiedByAttachedOptionParam: %s%n", indent, parser.aritySatisfiedByAttachedOptionParam());
  pw.printf("%scaseInsensitiveEnumValuesAllowed: %s%n", indent, parser.caseInsensitiveEnumValuesAllowed());
  pw.printf("%scollectErrors: %s%n", indent, parser.collectErrors());
  pw.printf("%slimitSplit: %s%n", indent, parser.limitSplit());
  pw.printf("%stoggleBooleanFlags: %s%n", indent, parser.toggleBooleanFlags());
}
origin: remkop/picocli

else if (config().posixClusteredShortOptionsAllowed() && arg.length() > 2 && arg.startsWith("-")) {
  if (tracer.isDebug()) {tracer.debug("Trying to process '%s' as clustered short options%n", arg, args);}
  processClusteredShortOptions(required, initialized, arg, args);
origin: remkop/picocli

/** Sets whether short options like {@code -x -v -f SomeFile} can be clustered together like {@code -xvfSomeFile}. The default is {@code true}.
 * <p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its
 * subcommands and nested sub-subcommands <em>at the moment this method is called</em>. Subcommands added
 * later will have the default setting. To ensure a setting is applied to all
 * subcommands, call the setter last, after adding subcommands.</p>
 * @param newValue the new setting
 * @return this {@code CommandLine} object, to allow method chaining
 * @since 3.0
 */
public CommandLine setPosixClusteredShortOptionsAllowed(boolean newValue) {
  getCommandSpec().parser().posixClusteredShortOptionsAllowed(newValue);
  for (CommandLine command : getCommandSpec().subcommands().values()) {
    command.setPosixClusteredShortOptionsAllowed(newValue);
  }
  return this;
}
origin: hazelcast/hazelcast-jet

else if (config().posixClusteredShortOptionsAllowed() && arg.length() > 2 && arg.startsWith("-")) {
  if (tracer.isDebug()) {tracer.debug("Trying to process '%s' as clustered short options%n", arg, args);}
  processClusteredShortOptions(required, initialized, arg, args);
origin: info.picocli/picocli

@Test
public void testParserPosixClustedShortOptions_false_disallowsShortOptionsAttachedToOptionParam() {
  String[] args = {"-oFILE"};
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), args);
  verifyCompact(compact, false, false, "FILE", null);
  CompactFields unclustered = new CompactFields();
  CommandLine cmd = new CommandLine(unclustered);
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  try {
    cmd.parse(args);
    fail("Expected exception");
  } catch (UnmatchedArgumentException ex) {
    assertEquals("Unknown option: -oFILE", ex.getMessage());
  }
}
@Test
origin: hazelcast/hazelcast-jet

/** Sets whether short options like {@code -x -v -f SomeFile} can be clustered together like {@code -xvfSomeFile}. The default is {@code true}.
 * <p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its
 * subcommands and nested sub-subcommands <em>at the moment this method is called</em>. Subcommands added
 * later will have the default setting. To ensure a setting is applied to all
 * subcommands, call the setter last, after adding subcommands.</p>
 * @param newValue the new setting
 * @return this {@code CommandLine} object, to allow method chaining
 * @since 3.0
 */
public CommandLine setPosixClusteredShortOptionsAllowed(boolean newValue) {
  getCommandSpec().parser().posixClusteredShortOptionsAllowed(newValue);
  for (CommandLine command : getCommandSpec().subcommands().values()) {
    command.setPosixClusteredShortOptionsAllowed(newValue);
  }
  return this;
}
origin: info.picocli/picocli

@Test
public void testParserPosixClustedShortOptions_false_resultsInShortClusteredOptionsNotRecognized() {
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), "-rvoFILE");
  verifyCompact(compact, true, true, "FILE", null);
  CommandLine cmd = new CommandLine(new CompactFields());
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  try {
    cmd.parse("-rvoFILE");
    fail("Expected exception");
  } catch (UnmatchedArgumentException ex) {
    assertEquals("Unknown option: -rvoFILE", ex.getMessage());
  }
}
@Test
origin: hazelcast/hazelcast-jet

/** Returns whether the parser accepts clustered short options. The default is {@code true}.
 * @return {@code true} if short options like {@code -x -v -f SomeFile} can be clustered together like {@code -xvfSomeFile}, {@code false} otherwise
 * @since 3.0 */
public boolean isPosixClusteredShortOptionsAllowed() { return getCommandSpec().parser().posixClusteredShortOptionsAllowed(); }
origin: info.picocli/picocli

@Test
public void testParserPosixClustedShortOptions_false_allowsUnclusteredShortOptions() {
  String[] args = "-r -v -o FILE".split(" ");
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), args);
  verifyCompact(compact, true, true, "FILE", null);
  CompactFields unclustered = new CompactFields();
  CommandLine cmd = new CommandLine(unclustered);
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  cmd.parse(args);
  verifyCompact(unclustered, true, true, "FILE", null);
}
origin: remkop/picocli

@Test
public void testParserPosixClustedShortOptions_false_disallowsShortOptionsAttachedToOptionParam() {
  String[] args = {"-oFILE"};
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), args);
  verifyCompact(compact, false, false, "FILE", null);
  CompactFields unclustered = new CompactFields();
  CommandLine cmd = new CommandLine(unclustered);
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  try {
    cmd.parse(args);
    fail("Expected exception");
  } catch (UnmatchedArgumentException ex) {
    assertEquals("Unknown option: -oFILE", ex.getMessage());
  }
}
@Test
origin: remkop/picocli

@Test
public void testParserPosixClustedShortOptions_false_resultsInShortClusteredOptionsNotRecognized() {
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), "-rvoFILE");
  verifyCompact(compact, true, true, "FILE", null);
  CommandLine cmd = new CommandLine(new CompactFields());
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  try {
    cmd.parse("-rvoFILE");
    fail("Expected exception");
  } catch (UnmatchedArgumentException ex) {
    assertEquals("Unknown option: -rvoFILE", ex.getMessage());
  }
}
@Test
origin: remkop/picocli

@Test
public void testParserPosixClustedShortOptions_false_allowsUnclusteredShortOptions() {
  String[] args = "-r -v -o FILE".split(" ");
  CompactFields compact = CommandLine.populateCommand(new CompactFields(), args);
  verifyCompact(compact, true, true, "FILE", null);
  CompactFields unclustered = new CompactFields();
  CommandLine cmd = new CommandLine(unclustered);
  cmd.getCommandSpec().parser().posixClusteredShortOptionsAllowed(false);
  cmd.parse(args);
  verifyCompact(unclustered, true, true, "FILE", null);
}
origin: remkop/picocli

/** Returns whether the parser accepts clustered short options. The default is {@code true}.
 * @return {@code true} if short options like {@code -x -v -f SomeFile} can be clustered together like {@code -xvfSomeFile}, {@code false} otherwise
 * @since 3.0 */
public boolean isPosixClusteredShortOptionsAllowed() { return getCommandSpec().parser().posixClusteredShortOptionsAllowed(); }
picocliCommandLine$Model$ParserSpecposixClusteredShortOptionsAllowed

Popular methods of CommandLine$Model$ParserSpec

  • separator
  • aritySatisfiedByAttachedOptionParam
  • caseInsensitiveEnumValuesAllowed
  • collectErrors
  • limitSplit
  • unmatchedOptionsArePositionalParams
  • splitQuotedStrings
  • trimQuotes
  • useSimplifiedAtFiles
  • atFileCommentChar
  • endOfOptionsDelimiter
  • expandAtFiles
  • endOfOptionsDelimiter,
  • expandAtFiles,
  • overwrittenOptionsAllowed,
  • stopAtPositional,
  • stopAtUnmatched,
  • toggleBooleanFlags,
  • unmatchedArgumentsAllowed,
  • <init>,
  • initFrom

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Notification (javax.management)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now