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

Design Document: First Step Towards Modularity #5236

Open
epage opened this issue Dec 1, 2023 · 0 comments
Open

Design Document: First Step Towards Modularity #5236

epage opened this issue Dec 1, 2023 · 0 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-enhancement Category: Raise on the bar on expectations E-hard Call for participation: Experience needed to fix: Hard / a lot
Milestone

Comments

@epage
Copy link
Member

epage commented Dec 1, 2023

This is more of a note dumping ground so I don't forget this in the lead up to 5.0.

  • Create sealed UsageWriter trait
    • Returns usage lines, without header or indentation
    • Create a NoUsage, FixedUsage, AutoUsage, AdaptiveUsage
  • Create sealed HelpWriter trait
    • Create a NoHelp, FixedHelp, HelpTemplate, and AutoHelp
    • Generic over usage
  • Create a Storage trait with sealed methods, making ArgMatches generic over it
    • Create new derive methods so this can be used implicitly to reduce constraints on derive and improve performance
  • Create ArgParser that is generic over the above
  • Deprecate all Command::...get_matches... functions except the most basic, pushing people to ArgParser
  • Deprecate all Command help/usage writing functions (maybe)

End result

  • Reduce binary size without the use of feature flags
  • Reduce requirements on derive users
  • Allow moving some Command state to ArgParser
  • Open door for more experimentation with custom usage/help
@epage epage added C-enhancement Category: Raise on the bar on expectations E-hard Call for participation: Experience needed to fix: Hard / a lot A-parsing Area: Parser's logic and needs it changed somehow. labels Dec 1, 2023
@epage epage added this to the 4.x milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-enhancement Category: Raise on the bar on expectations E-hard Call for participation: Experience needed to fix: Hard / a lot
Projects
None yet
Development

No branches or pull requests

1 participant