Basics
Guides
API Reference
Basics
Guides
API Reference
[127:7] extends: object
CliOptions is a reusable collection of CliOption declarations.
It stores the logical option definitions and lazily creates a new Apache
Commons CLI Options object whenever parsing or help formatting needs one.
That lets callers keep configuring options after adding them without the
Java-side option set getting stale.
CliOptions ()
Creates an empty set of command-line options.
add (Opt)
Adds an existing option declaration to the set.
Opt is the CliOption to add.this option set for chaining.flag (string ShortName = null, string LongName = null, string Description = null)
Creates and adds a flag option that does not take a value.
ShortName is the short option name without -.LongName is the long option name without --.Description is the help text for the flag.The created CliOption so callers can keep configuring it if needed.value (string ShortName = null, string LongName = null, string Description = null, bool Required = false)
Creates and adds an option that expects a single value.
ShortName is the short option name without -.LongName is the long option name without --.Description is the help text for the option.Required is true when the option must be supplied.The created CliOption so callers can keep configuring it if needed.optionList ()
Returns the logical option declarations in insertion order.
A list of CliOption objects.rawOptions ()
Builds and returns the wrapped Apache Commons CLI
Optionsobject. This is the AJI escape hatch for advanced callers.
An AussomJavaObject wrapping org.apache.commons.cli.Options.[16:7] extends: object
CliOption describes one command-line option declaration for CliParser.
It captures the short name, long name, description, whether the option
expects a value, whether it is required, and the display name used for the
value in help output. The wrapper stays mutable while the option is being
configured, then lazily creates the underlying Apache Commons CLI
Option object when the parser needs it.
CliOption (string ShortName = null, string LongName = null, string Description = null)
Creates a new command-line option declaration.
ShortName is the one-character or short option name without -.LongName is the long option name without --.Description is the help text shown for the option.arg (bool HasArg = true)
Marks whether the option expects a value argument.
HasArg is true when the option should consume a value.this option for chaining.required (bool Required = true)
Marks whether the option is required.
Required is true when parsing should fail if the option is omitted.this option for chaining.argName (string Name)
Sets the display name used for the option value in generated help text.
Name is the placeholder shown after the option name.this option for chaining.canonicalName ()
Returns the preferred public key for this option. Long names are preferred when present, otherwise the short name is used.
A string with the canonical option key.build ()
Builds and returns the wrapped Apache Commons CLI
Optionobject. Advanced users can use this as an AJI escape hatch when they need the raw Java object.
An AussomJavaObject wrapping org.apache.commons.cli.Option.[359:7] extends: object
CliParser parses a list of command-line arguments using a declared
CliOptions set and returns a CliParseResult.
It wraps Apache Commons CLI through AJI, formats help text on demand, and
keeps the public API small and script-friendly while still exposing the raw
Apache Options object through CliOptions.rawOptions() for advanced use.
CliParser ()
Creates a new parser with an empty option set.
options (Opts)
Sets the option declarations used for future parses and help output.
Opts is the CliOptions set to use.this parser for chaining.parse (list Args)
Parses the provided argument list. Apache Commons CLI parse failures are surfaced as exceptions.
Args is the command-line argument list to parse.A CliParseResult with the parsed values.parseOrExit (list Args, string Usage = null)
Parses the provided argument list and prints a readable error plus help text when parsing fails.
Args is the command-line argument list to parse.Usage is the command syntax line shown in help output.A CliParseResult on success or null on failure.formatHelp (string Usage = null)
Formats the current option set as help text.
Usage is the command syntax line shown at the top of the help output.A string with the formatted help text.help (string Usage = null)
Prints formatted help text for the current option set.
Usage is the command syntax line shown at the top of the help output.this parser for chaining.[207:7] extends: object
CliParseResult exposes the parsed option and argument values returned by
Apache Commons CLI using plain Aussom values where possible.
Options can be queried by either short or long name, positional arguments are
exposed as an Aussom list, and toMap() returns a compact summary of the
declared options plus the remaining positional arguments.
CliParseResult (object RawCommandLine, list OptionDefs)
Creates a wrapped parse result.
RawCommandLine is the wrapped Apache Commons CLI CommandLine object.OptionDefs is the list of declared CliOption definitions.has (string Name)
Returns true when the named option was present on the command line. Either the short or long option name may be used.
Name is the short or long option name to check.A bool with true when the option is present.value (string Name, Default = null)
Returns the first parsed value for an option or the provided default. Either the short or long option name may be used.
Name is the short or long option name.Default is the value to return when the option was not provided.The parsed string value or Default.values (string Name)
Returns all parsed values for an option as an Aussom list. This is useful when the same option is repeated multiple times.
Name is the short or long option name.A list of parsed values. The list is empty when the option was not supplied.args ()
Returns the remaining positional arguments after option parsing.
A list of positional argument strings.arg (int Index, Default = null)
Returns one positional argument by index or the provided default.
Index is the zero-based positional argument index.Default is the value to return when the index is out of range.The positional argument string or Default.toMap ()
Converts the parsed result into a plain Aussom map. Flag options become bool values. Value-taking options become a string when one value was supplied or a list when the option appeared multiple times. Positional arguments are stored under the
argskey.
A map with the parsed option state and positional arguments.javaListToList (JavaList)
Converts a wrapped Java
Listinto an Aussom list.
JavaList is the wrapped Java list to copy from.A new Aussom list with the copied values.arrayToList (Arr)
Converts a wrapped Java array into an Aussom list.
Arr is the wrapped Java array to copy from.A new Aussom list with the copied values.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.