FlagsFlags is a library for reading user input in an order-independent manner.
The user interface of Flags is similar to most Git commands:
-f (both equivalent).
- Any argument starting with two dashes (
--flag, for example) is considered a flag. The next argument will be read as the value for that flag.
- Any argument starting with one dash, but not two (
-f) is considered a shorthand flag. This will be converted to a regular flag - which one is specified in the program. The next argument will be read as the value for that flag.
Codewise, the developer is provided with an immutable
Map-like structure for reading flags. You may call
get(String flag) to get the value for a flag or
isPresent(String flag) to see if a flag is present.