New library: argparse, for parsing CLI arguments
Steven Schveighoffer
schveiguy at gmail.com
Wed Oct 13 14:36:30 UTC 2021
On 10/13/21 7:27 AM, Andrey Zherikov wrote:
> Hi everyone,
>
> I'm happy to announce that I've published a CLI argument parsing library
> - [argparse](https://code.dlang.org/packages/argparse). It's been around
> for some time already so please take a look and provide your feedback if
> you haven't done so.
>
> The reasoning to create one more CLI parsing library is that the
> existing libraries do not provide enough flexibility in parsing that I'm
> looking for and/or they depend on other libraries. As a result
> `argparse` supports wide variety of data types including enums,
> callbacks and arrays as well as a fully customized argument parsing. It
> also doesn't depend on anything besides the standard library.
>
> Since it's in active development (activeness depends on my availability
> of course), I have few things to do before making the first major
> release so stay tuned and/or contribute if you'd like to.
I was literally just thinking about how something like this would be
useful yesterday. It's amazing when the universe just listens to me and
provides what I was hoping for!
One nitpick -- you should be able to opt in using the name of the field
member instead of having to write `@NamedArgument`. e.g. your `string
unused` parameter requires a `@NamedArgument("unused")` which seems
unnecessary.
-Steve
More information about the Digitalmars-d-announce
mailing list