Module dev.nipafx.args
module dev.nipafx.args
A simple command-line argument parser for Java applications that relies on records and
sealed interfaces.
Specifically, it uses their component names to parse command line arguments, their canonical constructors to create instances, and their immutability to let you freely pass them around without fear of unwanted changes. It uses sealed interfaces to model mutually exclusive sets of arguments, so-called "modes".
To use it, create a record or sealed interface with only record implementations,
make it public and export its package or keep it package-private and open the package
to this module, and call
Args.parse(args, ArgsRecord.class)
to parse the string array args to an instance of your record (ArgsRecord,
in this example). You can also parse to multiple args records by passing multiple type
tokens to Args::parse.
-
Packages
ExportsPackageDescriptionMain package of Record Args - see module declaration andArgsfor documentation.