cli-args 2.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 argumentdocs
).
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();
- Registered by asperan
- 2.0.0 released 3 years ago
- asperan/cli-args
- MIT
- Copyright © 2021, Alex Speranza
- Authors:
- Dependencies:
- option
- Versions:
-
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 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
45 downloads total
-
- Score:
- 0.0
- Short URL:
- cli-args.dub.pm