Package com.google.googlejavaformat.java
Class CommandLineOptionsParser
- java.lang.Object
-
- com.google.googlejavaformat.java.CommandLineOptionsParser
-
final class CommandLineOptionsParser extends java.lang.ObjectA parser forCommandLineOptions.
-
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.base.SplitterARG_SPLITTERprivate static com.google.common.base.SplitterCOLON_SPLITTERprivate static com.google.common.base.SplitterCOMMA_SPLITTER
-
Constructor Summary
Constructors Constructor Description CommandLineOptionsParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidexpandParamsFiles(java.lang.Iterable<java.lang.String> args, java.util.List<java.lang.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 java.lang.StringgetValue(java.lang.String flag, java.util.Iterator<java.lang.String> it, java.lang.String value)(package private) static CommandLineOptionsparse(java.lang.Iterable<java.lang.String> options)ParsesCommandLineOptions.private static java.lang.IntegerparseInteger(java.util.Iterator<java.lang.String> it, java.lang.String flag, java.lang.String value)private static com.google.common.collect.Range<java.lang.Integer>parseRange(java.lang.String arg)Parse a range, as in "1:12" or "42".private static voidparseRangeSet(com.google.common.collect.RangeSet<java.lang.Integer> result, java.lang.String ranges)Parse multiple --lines flags, like {"1:12,14,20:36", "40:45,50"}.
-
-
-
Method Detail
-
parse
static CommandLineOptions parse(java.lang.Iterable<java.lang.String> options)
ParsesCommandLineOptions.
-
parseInteger
private static java.lang.Integer parseInteger(java.util.Iterator<java.lang.String> it, java.lang.String flag, java.lang.String value)
-
getValue
private static java.lang.String getValue(java.lang.String flag, java.util.Iterator<java.lang.String> it, java.lang.String value)
-
parseRangeSet
private static void parseRangeSet(com.google.common.collect.RangeSet<java.lang.Integer> result, java.lang.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
private static com.google.common.collect.Range<java.lang.Integer> parseRange(java.lang.String arg)
Parse a range, as in "1:12" or "42". Line numbers provided are1-based, but are converted here to0-based.
-
expandParamsFiles
private static void expandParamsFiles(java.lang.Iterable<java.lang.String> args, java.util.List<java.lang.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.
-
-