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

Deferred command descriptions #72

Open
Anaminus opened this issue Jul 22, 2022 · 0 comments
Open

Deferred command descriptions #72

Anaminus opened this issue Jul 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Anaminus
Copy link
Owner

Cobra, as well as most flag packages, requires specifying the description of a command as a string. Because rbxmk descriptions are dynamic, this means that a lot of work is put into initializing descriptions even if they aren't used.

rbxmk's fork of Cobra should be fitted with an option to defer its descriptions. This can be implemented as the following: When getting the description of a command, if the description field is empty, check the description resolver field, which is a function that returns a string. If specified, call it, and set the description field to the result.

@Anaminus Anaminus added the enhancement New feature or request label Jul 22, 2022
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

1 participant