nxt.cli

Command-Line-Interface (CLI) utilities.

Expose CLI based on a root type being a struct or class or module. By default it creates an instance of an aggregate and expose members as sub-command. This handles D types, files, etc.

Reflects on nxt.path, string, and other built-in types using arg.to!Arg.

Constructor of T is also reflected as flags before sub-command.

TODO: Use in MLParser: - --requestedFormats=C,D or --fmts because arg is a Fmt[] - scan dirPath

Auto-gen of help also works if any arg in args is --help or -h.

Members

Enums

Match
enum Match

Match method to use when matching CLI sub-commands with member functions.

Functions

evalMemberCommand
bool evalMemberCommand(T arg, const(string)[] cmd, Flags flags)

Evaluate cmd as a CLI-like sub-command calling a member of T. Typically called with the args passed to a main function.

Structs

Flags
struct Flags
Undocumented in source.

Meta