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

UX: provide default value for -seed (bool) option in help text #39

Open
pataquets opened this issue May 5, 2023 · 1 comment
Open

Comments

@pataquets
Copy link
Contributor

As it's being done for -tcpPeers or -utpPeers, for instance.
I've read the code, from which I assume default is false, but found no Default: example help text for sending a PR. I guess the command line parser lib is introspecting the options struct.

@anacrolix
Copy link
Owner

You are correct, the decision is made here: https://github.com/anacrolix/tagflag/blob/45431b4b2c93f05f0f6c6fff266a7817d35c8f69/usage.go#L82. I could make it more selective for when to show the defaults (always show for non-nil pointers, and everything else would probably be better). A further improvement would be to show the current value as parsed (I think that's actually what it's showing now, which isn't great). My current preference for arg parsing is what I'm working in https://github.com/anacrolix/bargle/tree/ng, but I don't want to subject the project to the churn to change to that, tagflag is pretty simple.

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

No branches or pull requests

2 participants