cli-args 4.0.0+20220226

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


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);})
  • Alex "asperan" Speranza
4.0.0+20220226 2022-Feb-26
3.0.1+20220129 2022-Jan-29
3.0.1 2021-Oct-14
3.0.0 2021-Oct-14
2.0.0 2021-Oct-14
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 44 downloads total

Short URL: