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

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

Best Java code snippets using picocli.CommandLine$Model$ParserSpec.limitSplit (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

String[] splitValue(String value, ParserSpec parser, Range arity, int consumed) {
  if (splitRegex().length() == 0) { return new String[] {value}; }
  int limit = parser.limitSplit() ? Math.max(arity.max - consumed, 0) : 0;
  if (parser.splitQuotedStrings()) {
    return debug(value.split(splitRegex(), limit), "Split (ignoring quotes)", value);
  }
  return debug(splitRespectingQuotedStrings(value, limit, parser, this, splitRegex()), "Split", value);
}
private String[] debug(String[] result, String msg, String value) {
origin: remkop/picocli

@Test
public void testMapFieldHelpSplit_with_limitSplit() {
  class App {
    @Parameters(arity = "2", split = "\\|",
        paramLabel = "FIXTAG=VALUE",
        description = "Exactly two lists of vertical bar '|'-separated FIXTAG=VALUE pairs.")
    Map<Integer,String> message;
    @Option(names = {"-P", "-map"}, split = ",",
        paramLabel = "TIMEUNIT=VALUE",
        description = "Any number of TIMEUNIT=VALUE pairs. These may be specified separately (-PTIMEUNIT=VALUE) or as a comma-separated list.")
    Map<TimeUnit, String> map;
  }
  CommandSpec spec = CommandSpec.forAnnotatedObject(new App());
  spec.parser().limitSplit(true);
  String actual = usageString(new CommandLine(spec), Help.Ansi.OFF);
  String expected = String.format("" +
      "Usage: <main class> [-P=TIMEUNIT=VALUE[,TIMEUNIT=VALUE]...]...%n" +
      "                    (FIXTAG=VALUE\\|FIXTAG=VALUE)...%n" +
      "      (FIXTAG=VALUE\\|FIXTAG=VALUE)...%n" +
      "         Exactly two lists of vertical bar '|'-separated FIXTAG=VALUE pairs.%n" +
      "  -P, -map=TIMEUNIT=VALUE[,TIMEUNIT=VALUE]...%n" +
      "         Any number of TIMEUNIT=VALUE pairs. These may be specified separately%n" +
      "           (-PTIMEUNIT=VALUE) or as a comma-separated list.%n");
  assertEquals(expected, actual);
}
origin: hazelcast/hazelcast-jet

String optionalSep  = empty(split) ? " [" : "[" + split;
boolean unlimitedSplit = !empty(split) && !commandSpec.parser().limitSplit();
boolean limitedSplit =   !empty(split) &&  commandSpec.parser().limitSplit();
Text repeating = paramName;
int paramCount = 1;
origin: info.picocli/picocli

spec.parser().limitSplit(true);
String actual = usageString(new CommandLine(spec), Help.Ansi.OFF);
String expected = String.format("" +
origin: info.picocli/picocli

@Test
public void testMapFieldHelpSplit_with_limitSplit() {
  class App {
    @Parameters(arity = "2", split = "\\|",
        paramLabel = "FIXTAG=VALUE",
        description = "Exactly two lists of vertical bar '|'-separated FIXTAG=VALUE pairs.")
    Map<Integer,String> message;
    @Option(names = {"-P", "-map"}, split = ",",
        paramLabel = "TIMEUNIT=VALUE",
        description = "Any number of TIMEUNIT=VALUE pairs. These may be specified separately (-PTIMEUNIT=VALUE) or as a comma-separated list.")
    Map<TimeUnit, String> map;
  }
  CommandSpec spec = CommandSpec.forAnnotatedObject(new App());
  spec.parser().limitSplit(true);
  String actual = usageString(new CommandLine(spec), Help.Ansi.OFF);
  String expected = String.format("" +
      "Usage: <main class> [-P=TIMEUNIT=VALUE[,TIMEUNIT=VALUE]...]...%n" +
      "                    (FIXTAG=VALUE\\|FIXTAG=VALUE)...%n" +
      "      (FIXTAG=VALUE\\|FIXTAG=VALUE)...%n" +
      "         Exactly two lists of vertical bar '|'-separated FIXTAG=VALUE pairs.%n" +
      "  -P, -map=TIMEUNIT=VALUE[,TIMEUNIT=VALUE]...%n" +
      "         Any number of TIMEUNIT=VALUE pairs. These may be specified separately%n" +
      "           (-PTIMEUNIT=VALUE) or as a comma-separated list.%n");
  assertEquals(expected, actual);
}
origin: hazelcast/hazelcast-jet

private boolean splitFirst()                       { return limitSplit(); }
/** Returns true if arguments should be split first before any further processing and the number of
origin: info.picocli/picocli

private <T> T parseCommonsCliCompatible(T obj, String[] args) {
  CommandLine cmd = new CommandLine(obj);
  cmd.getCommandSpec().parser()
      .limitSplit(true)
      .aritySatisfiedByAttachedOptionParam(true);
  cmd.parseArgs(args);
  return obj;
}
origin: hazelcast/hazelcast-jet

String[] splitValue(String value, ParserSpec parser, Range arity, int consumed) {
  if (splitRegex().length() == 0) { return new String[] {value}; }
  int limit = parser.limitSplit() ? Math.max(arity.max - consumed, 0) : 0;
  if (parser.splitQuotedStrings()) {
    return debug(value.split(splitRegex(), limit), "Split (ignoring quotes)", value);
  }
  return debug(splitRespectingQuotedStrings(value, limit, parser), "Split", value);
}
private String[] debug(String[] result, String msg, String value) {
origin: remkop/picocli

String optionalSep  = empty(split) ? " [" : "[" + split;
boolean unlimitedSplit = !empty(split) && !commandSpec.parser().limitSplit();
boolean limitedSplit =   !empty(split) &&  commandSpec.parser().limitSplit();
Text repeating = paramName;
int paramCount = 1;
origin: remkop/picocli

spec.parser().limitSplit(true);
String actual = usageString(new CommandLine(spec), Help.Ansi.OFF);
String expected = String.format("" +
origin: remkop/picocli

private boolean splitFirst()                       { return limitSplit(); }
/** Returns true if arguments should be split first before any further processing and the number of
origin: remkop/picocli

private <T> T parseCommonsCliCompatible(T obj, String[] args) {
  CommandLine cmd = new CommandLine(obj);
  cmd.getCommandSpec().parser()
      .limitSplit(true)
      .aritySatisfiedByAttachedOptionParam(true);
  cmd.parseArgs(args);
  return obj;
}
picocliCommandLine$Model$ParserSpeclimitSplit

Javadoc

Returns true if arguments should be split first before any further processing and the number of parts resulting from the split is limited to the max arity of the argument.

Popular methods of CommandLine$Model$ParserSpec

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

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • putExtra (Intent)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Top 12 Jupyter Notebook extensions
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