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

Update help example to use vars #429

Merged
merged 2 commits into from
May 27, 2024
Merged

Conversation

alex-broad
Copy link
Contributor

Fixes #426

@alecthomas
Copy link
Owner

I think this would be better in the README, there's no need to add it to an arbitrary example.

@alecthomas alecthomas closed this May 26, 2024
@alex-broad
Copy link
Contributor Author

alex-broad commented May 27, 2024

As discussed in #426, others have come to the help example code. The README already has discussion of variable interpolation. Why not both? I'd argue the reason people are looking at specific examples is that the README is already pretty long and covers a lot; examples are usually more concise and directed.

At the very least it's worth removing the incorrect func (f *flagWithHelp) Help() string as the HelpProvider interface explicitly only supports args/commands.

@alecthomas
Copy link
Owner

Seems reasonable.

@alecthomas alecthomas reopened this May 27, 2024
@alecthomas alecthomas merged commit 38e5c61 into alecthomas:master May 27, 2024
5 checks passed
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.

Help() Interface on flags seemingly unused?
2 participants