ArgumentsExt

Application extension to parse command line arguments.

This extension is an extension itself, providing new hooks via IArgumentsExtExtension.

By default it adds a --help command line argument to show a help message.

Constructors

this
this(istring name, istring desc, istring usage, istring help, FormatOutput stdout, FormatOutput stderr)

Constructor.

Members

Functions

atExit
void atExit(IApplication app, istring[] args, int status, ExitException exception)
Undocumented in source. Be warned that the author may not have intended to support it.
onExitException
ExitException onExitException(IApplication app, istring[] args, ExitException exception)
Undocumented in source. Be warned that the author may not have intended to support it.
order
int order()

Extension order. This extension uses -100_000 because it should be called very early.

postRun
void postRun(IApplication app, istring[] args, int status)

Unused IApplicationExtension methods.

preRun
void preRun(IApplication app, istring[] cl_args)

Setup, parse, validate and process command line args (Application hook).

Mixins

__anonymous
mixin ExtensibleClassMixin!(IArgumentsExtExtension)

Adds a list of extensions (this.extensions) and methods to handle them. See ExtensibleClassMixin documentation for details.

Variables

args
Arguments args;

Command line arguments parser and storage.

stderr
FormatOutput stderr;

Formatted output stream to use to print error messages.

stdout
FormatOutput stdout;

Formatted output stream to use to print normal messages.

Inherited Members

From IApplicationExtension

IApplication
alias IApplication = .IApplication

Alias of IApplication, for use by implementing classes without needing to import ocean.util.app.model.IApplication.

preRun
void preRun(IApplication app, istring[] args)

Function executed before the program runs.

postRun
void postRun(IApplication app, istring[] args, int status)

Function executed after the program runs.

atExit
void atExit(IApplication app, istring[] args, int status, ExitException exception)

Function executed at program exit.

onExitException
ExitException onExitException(IApplication app, istring[] args, ExitException exception)

Function executed if (and only if) an ExitException was thrown.

Meta