Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ddoc as description for helptexts #156

Open
gizmomogwai opened this issue Jan 1, 2024 · 4 comments
Open

Support ddoc as description for helptexts #156

gizmomogwai opened this issue Jan 1, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@gizmomogwai
Copy link
Contributor

gizmomogwai commented Jan 1, 2024

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: dlang/dmd#6872 where one of the usecases was especially commandline help generation).

@andrey-zherikov
Copy link
Owner

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
Copy link
Contributor Author

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.

@andrey-zherikov andrey-zherikov added the enhancement New feature or request label Jan 13, 2024
@gizmomogwai
Copy link
Contributor Author

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

@andrey-zherikov
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants