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

Prototype out a help trait #119

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Prototype out a help trait #119

wants to merge 4 commits into from

Conversation

erickt
Copy link
Collaborator

@erickt erickt commented Feb 8, 2022

This is a prototype to explore an alternative to #115. The idea here is that we change argh_derive to produce an implementation of a new Help trait, that has an associated constant that describes the trait. I've changed argh_derive to use this helper to produce the help string.

There's a couple things I'm not crazy about:

cc @claywilkinson and @richkadel

@erickt erickt marked this pull request as draft February 8, 2022 03:13
@erickt erickt force-pushed the help-trait branch 2 times, most recently from 2608a2d to 85bdb1d Compare February 8, 2022 03:14
@erickt
Copy link
Collaborator Author

erickt commented Feb 8, 2022

Pushed up some new patches to:

  • Move the help traits into argh_shared, and use some of them in argh_derive. Unfortunately I don't have a great way to deal with subcommand in argh_derive though.
  • Got rid of using curried format functions for examples and notes, and replaced with a simple string replacement. It's not quite a correct substitution though, since it'll replace {{command_name}}, but the old argh_derive will not.
  • Added an optional serde implementations.

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

Successfully merging this pull request may close these issues.

None yet

1 participant