ae.utils.funopt

Translate command-line parameters to a function signature, generating --help text automatically.

Members

Functions

funopt
auto funopt(string[] args)

Parse the given arguments according to FUN's parameters, and call FUN. Throws GetOptException on errors.

funoptDispatch
auto funoptDispatch(string[] args)

Dispatch the command line to a type's static methods, according to the first parameter on the given command line (the "action"). String UDAs are used as usage documentation for generating --help output (or when no action is specified).

Structs

FunOptConfig
struct FunOptConfig
Undocumented in source.
OptionImpl
struct OptionImpl(OptionType type_, T_, string description_, char shorthand_, string placeholder_)
Undocumented in source.

Templates

Option
template Option(T, string description = null, string placeholder = null, char shorthand = 0)

An option with a value (e.g. --tries N). The default placeholder depends on the type (N for numbers, STR for strings).

Parameter
template Parameter(T, string description = null)

An ordered parameter.

Switch
template Switch(string description = null, char shorthand = 0)

An on/off switch (e.g. --verbose). Does not have a value, other than its presence.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>