Skip to content

Conversation

@alimpfard
Copy link

Here's my suggestion from #410 to (begin to) resolve it.

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
All committers have signed the CLA.

flag_test.go Outdated
Comment on lines 1274 to 1276
const defaultOutput = ` --A[=value] for bootstrapping, allow 'any' type
--Alongflagname[=value] disable bounds checking
-C, --CCC[=value] a boolean defaulting to true (default true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I'd prefer if this said [=true|false] or something like that, to clarify that those are the only valid values. Since the implementation special-cases bool values anyway, that should be relatively straightforward to implement, I think. Not sure what the best format in the help is, though - effectively there are four ways to get two values, and that easily gets confusing:

  • omit the flag, get the default value
  • specify the flag without a value, get true
  • specify the flag with a value, either true or false, and get that

Can we somehow convey all those effects in the help output?

Copy link
Author

Choose a reason for hiding this comment

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

I called it value as the alternative (with varname != "") would look like [=foo] (also that [=true|false] just seemed too long...but sure, bool is special enough anyway.
Re "specify the flag without a value to get true", not sure...

Copy link
Collaborator

@tomasaschan tomasaschan left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

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.

3 participants