cli-args 3.0.0

An extendible simple framework to parse command line options and arguments.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Cli-args

Cli-args is a library for D for parsing command line arguments and options.

It provides the bases to create your own custom parser and also a basic implementation (in the module asperan.cli_args.simple_option_parser).

The base class provides support for 2 kind of argument:

  • "flag" arguments, which do not need additional arguments as they work like switches (for example, the usual options --help or --version);
  • other options, which needs an additional arguments (i.e. for dub --build docs: option --build, additional argument docs).

The provided parser just passes along the unrecognized arguments, so no option is lost.

Examples

CommandLineOptionParser op = SimpleOptionParserBuilder()
	.addOption("-v", "--version", "Print the program version and exit", () {writeln("void");})
	.addOption("-h", "--help", "Print the help message and exit", () {writeln("help");})
	.addOption("-d", "--debug", "Print the next argument", (string arg) {writeln(arg);})
	.build();
Authors:
  • Alex "asperan" Speranza
Dependencies:
option
Versions:
3.0.1 2021-Oct-14
3.0.0 2021-Oct-14
2.0.0 2021-Oct-14
~main 2021-Oct-14
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 2 downloads total

Score:
0.4
Short URL:
cli-args.dub.pm