Package net.morimekta.console.args
Class ArgumentOptions
- java.lang.Object
-
- net.morimekta.console.args.ArgumentOptions
-
public class ArgumentOptions extends java.lang.Object
Options for configuring the argument parser.
-
-
Constructor Summary
Constructors Constructor Description ArgumentOptions(STTY tty)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArgumentOptions
defaults()
static ArgumentOptions
defaults(STTY tty)
java.util.Comparator<BaseOption>
getOptionComparator()
java.lang.String
getSubCommandsString()
int
getUsageWidth()
boolean
isDefaultsShown()
boolean
isSubCommandsShown()
ArgumentOptions
withDefaultsShown(boolean show)
Set whether the default values should be printed in usage.ArgumentOptions
withMaxUsageWidth(int maxWidth)
Set the maximum usage width.ArgumentOptions
withOptionComparator(java.util.Comparator<BaseOption> comparator)
ArgumentOptions
withSubCommandsShown(boolean subCommandsShown)
ArgumentOptions
withSubCommandsString(java.lang.String subCommandsString)
ArgumentOptions
withUsageWidth(int usageWidth)
Set the number of columns to be used for usage printing.
-
-
-
Constructor Detail
-
ArgumentOptions
public ArgumentOptions(STTY tty)
-
-
Method Detail
-
defaults
public static ArgumentOptions defaults()
-
defaults
public static ArgumentOptions defaults(STTY tty)
-
withDefaultsShown
public ArgumentOptions withDefaultsShown(boolean show)
Set whether the default values should be printed in usage.- Parameters:
show
- If the default values should be printed.- Returns:
- The Argument options.
-
isDefaultsShown
public boolean isDefaultsShown()
- Returns:
- True if the default values should be printed in usage.
-
withUsageWidth
public ArgumentOptions withUsageWidth(int usageWidth)
Set the number of columns to be used for usage printing.- Parameters:
usageWidth
- The number of columns.- Returns:
- The Argument options.
-
withMaxUsageWidth
public ArgumentOptions withMaxUsageWidth(int maxWidth)
Set the maximum usage width. The width is set as wide as possible based on the terminal column count, but maximum the maxWidth.- Parameters:
maxWidth
- The maximum width.- Returns:
- The Argument options.
-
getUsageWidth
public int getUsageWidth()
- Returns:
- Number of columns to be used for usage printing.
-
withOptionComparator
public ArgumentOptions withOptionComparator(java.util.Comparator<BaseOption> comparator)
-
getOptionComparator
public java.util.Comparator<BaseOption> getOptionComparator()
-
isSubCommandsShown
public boolean isSubCommandsShown()
-
withSubCommandsShown
public ArgumentOptions withSubCommandsShown(boolean subCommandsShown)
-
getSubCommandsString
public java.lang.String getSubCommandsString()
-
withSubCommandsString
public ArgumentOptions withSubCommandsString(java.lang.String subCommandsString)
-
-