Flags are non-positional arguments passed to the app. Flags can be generally used as either an argument flag, which expects an argument parsed as type F, or boolean flags which do not.
Attributes
- F
The type expected to parse the flag argument as.
- Companion:
- object
- Source:
- Flag.scala
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
A partial function that will take the String value of the passed argument, and convert it to type F.
A partial function that will take the String value of the passed argument, and convert it to type F.
Typical usage might be for parsing String to Int/Float/Custom Domain, e.g. for a Flag[Int], parse = str => str.toInt.
Advanced usage could be used to do more targeted work as well, such as processing the argument directly, versus simply obtaining the value for it to be parsed later, e.g. for a Flag[String], parse = str => str.toUpperCase
Attributes
- Returns:
the evaluation of String => F
- Source:
- Flag.scala
Concrete methods
Checks if flags to trigger this Flag are present in the provided Command arguments
Checks if flags to trigger this Flag are present in the provided Command arguments
Attributes
- args
The arguments passed to the command
- Returns:
true if present, otherwise false
- Source:
- Flag.scala
A method that will find the first instance of an argument triggering this Flag, if present, and evaluate the parseArgument partial function on it.
A method that will find the first instance of an argument triggering this Flag, if present, and evaluate the parseArgument partial function on it.
Most useful when this Flag is expected once.
Attributes
- args
The arguments passed to the command
- See also:
- Source:
- Flag.scala
Finds instances of arguments that trigger this Flag, and processes them through parseArgument
Finds instances of arguments that trigger this Flag, and processes them through parseArgument
Attributes
- args
The arguments passed to the command
- Source:
- Flag.scala
A method to remove the flag trigger, and any arguments, from the input args, so that positional Args can then be processed
A method to remove the flag trigger, and any arguments, from the input args, so that positional Args can then be processed
Attributes
- Source:
- Flag.scala
Abstract fields
A description of the purpose of this flag, used in documentation.
The name of the flag, e.g. "help". This will be parsed as s"--$name", e.g. "--help"
The name of the flag, e.g. "help". This will be parsed as s"--$name", e.g. "--help"
Attributes
- Source:
- Flag.scala
A short-key version of name, e.g. "h". This will be parsed as s"-$shortKey", e.g. "-h"
A short-key version of name, e.g. "h". This will be parsed as s"-$shortKey", e.g. "-h"
Attributes
- Source:
- Flag.scala
Concrete fields
Indicates this Flag expects an argument. Defaults to true.