Package com.google.googlejavaformat.java
Class CommandLineOptionsParser
java.lang.Object
com.google.googlejavaformat.java.CommandLineOptionsParser
A parser for
CommandLineOptions.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.base.Splitterprivate static final com.google.common.base.Splitterprivate static final com.google.common.base.Splitter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidexpandParamsFiles(Iterable<String> args, List<String> expanded) Pre-processes an argument list, expanding arguments of the form@filenameby reading the content of the file and appending whitespace-delimited options toarguments.private static String(package private) static CommandLineOptionsParsesCommandLineOptions.private static IntegerparseInteger(Iterator<String> it, String flag, String value) private static com.google.common.collect.Range<Integer> parseRange(String arg) Parse a range, as in "1:12" or "42".private static voidparseRangeSet(com.google.common.collect.RangeSet<Integer> result, String ranges) Parse multiple --lines flags, like {"1:12,14,20:36", "40:45,50"}.
-
Field Details
-
COMMA_SPLITTER
private static final com.google.common.base.Splitter COMMA_SPLITTER -
COLON_SPLITTER
private static final com.google.common.base.Splitter COLON_SPLITTER -
ARG_SPLITTER
private static final com.google.common.base.Splitter ARG_SPLITTER
-
-
Constructor Details
-
CommandLineOptionsParser
CommandLineOptionsParser()
-
-
Method Details
-
parse
ParsesCommandLineOptions. -
parseInteger
-
getValue
-
parseRangeSet
private static void parseRangeSet(com.google.common.collect.RangeSet<Integer> result, String ranges) Parse multiple --lines flags, like {"1:12,14,20:36", "40:45,50"}. Multiple ranges can be given with multiple --lines flags or separated by commas. A single line can be set by a single number. Line numbers are1-based, but are converted to the0-based numbering used internally by google-java-format. -
parseRange
Parse a range, as in "1:12" or "42". Line numbers provided are1-based, but are converted here to0-based. -
expandParamsFiles
Pre-processes an argument list, expanding arguments of the form@filenameby reading the content of the file and appending whitespace-delimited options toarguments.
-