Skip to content

Prioritize defaultText over value in docs #9

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

joshuaswickirl
Copy link

In cases where the default value is dynamic or programmatic, it'd be nice to be able to align the docs with the help text.

https://cli.urfave.org/v3/examples/flags/advanced/#default-values-for-help-output

@joshuaswickirl joshuaswickirl requested a review from a team as a code owner April 11, 2025 21:57
@@ -565,21 +565,19 @@ func getFlagDefaultValue(f cli.DocGenerationFlag) string {
return ""
}

if v, ok := f.(interface{ GetValue() string }); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuaswickirl i'm having a hard time wrapping my head around this. You say that DocGenerationFlag has removed GetValue ?? It's still there. So I'm confused why we need all this in the first place. Moreover there is no need to use reflection here. You should be able to use be existing functions to achieve the desired result

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.

2 participants