andrey-zherikov / argparse

Parser for command-line arguments
https://andrey-zherikov.github.io/argparse/
Boost Software License 1.0
30 stars 6 forks source link

Support ddoc as description for helptexts #156

Open gizmomogwai opened 8 months ago

gizmomogwai commented 8 months ago

I was playing with rust/clap and one feature I really liked there was, that you can use doc-comments as an alternative to annotations to document flags/commands... Not sure that its possible to get to the doc-comments in dlang though (I found an old issue: https://github.com/dlang/dmd/pull/6872 where one of the usecases was especially commandline help generation).

andrey-zherikov commented 8 months ago

I think I got what you are looking for but to be sure, could you please provide more details (e.g., an example) of what you want?

gizmomogwai commented 8 months ago

instead of

    @(NamedArgument(["aFlag"]).Description("test description"))
    bool aFlag;

it would perhaps be interesting to be able to write

    /// test description
    @(NamedArgument(["aFlag"]))
    bool aFlag;

if both variants are there, then the explicit description should win. Unfortunately I think there is no way to get to the /// information at compile time.

gizmomogwai commented 7 months ago

Might be something for opend ... perhaps this feature will be "back" ported to dlang :)

andrey-zherikov commented 7 months ago

Yeah. I'm not sure it's implemented already but I'll definitely take a look.