VersionArgsExt

Application extension to log or output the version information.

This extension is an ArgumentsExt and a LogExt extension, being optional for both (but makes no sense unless it's registered at least as one of them).

If it's registered as an ArgumentsExt, it adds the option --version to print the version information and exit. (Note that the actual handling of the --version command line option is performed by ArgumentsExt.)

If it's registered as a LogExt, it will log the version information using the logger with the name of this module.

Constructors

this
this(VersionInfo ver, bool default_logging, istring default_file)

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 late.

postConfigureLoggers
void postConfigureLoggers(IApplication app, ConfigParser config, bool loose_config_parsing, bool use_insert_appender)

Add the default logger if default_logging is true.

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

Unused IApplicationExtension methods.

preConfigureLoggers
void preConfigureLoggers(IApplication app, ConfigParser config, bool loose_config_parsing, bool use_insert_appender)

Unused ILogExtExtension methods.

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

Print the version information to the log if the ConfigExt and LogExt are present.

preValidateArgs
void preValidateArgs(IApplication app, Arguments args)

Checks whether the --version flag is present and, if it is, prints the app version and exits without further arguments validation.

processArgs
void processArgs(IApplication app, Arguments args)
Undocumented in source. Be warned that the author may not have intended to support it.
setupArgs
void setupArgs(IApplication app, Arguments args)

Adds the command line option --version.

setupUnixSocketHandler
void setupUnixSocketHandler(IApplication app, UnixSocketExt unix_socket_ext, istring version_command)

Registers this extension with the unix socket extension and activates the handling of the specified unix socket command, which will print the application version (as shown by --version) to the socket when called.

validateArgs
cstring validateArgs(IApplication app, Arguments args)

Unused IArgumentsExtension methods.

Variables

default_file
istring default_file;

Default name of the file to log when using the default logger.

default_logging
bool default_logging;

True if a default logger for the version should be added.

ver
VersionInfo ver;

Version information.

ver_log
Logger ver_log;

Logger to use to log the version information.

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.

From IArgumentsExtExtension

setupArgs
void setupArgs(IApplication app, Arguments args)

Function executed when command line arguments are set up (before parsing).

preValidateArgs
void preValidateArgs(IApplication app, Arguments args)

Function executed after parsing of command line args (whether the basic parsing failed or succeeded) but before the call to validateArgs().

validateArgs
cstring validateArgs(IApplication app, Arguments args)

Function executed after parsing the command line arguments.

processArgs
void processArgs(IApplication app, Arguments args)

Function executed after (successfully) validating the command line arguments.

From ILogExtExtension

preConfigureLoggers
void preConfigureLoggers(IApplication app, ConfigParser config, bool loose_config_parsing, bool use_insert_appender)

Function executed before the loggers are configured.

postConfigureLoggers
void postConfigureLoggers(IApplication app, ConfigParser config, bool loose_config_parsing, bool use_insert_appender)

Function executed after the loggers are configured.

Meta