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

flag: add FlagSet usage examples #36307

Open
obeyda opened this issue Dec 29, 2019 · 10 comments · May be fixed by #64443
Open

flag: add FlagSet usage examples #36307

obeyda opened this issue Dec 29, 2019 · 10 comments · May be fixed by #64443
Labels
Documentation help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@obeyda
Copy link
Contributor

obeyda commented Dec 29, 2019

What did you expect to see?

Having some examples on the flag package's docs showing how to create subcommands with FlagSet.

What did you see instead?

There's only a package example and Value interface usage and none of them shows how to use FlagSet to create subcommands.

@mvdan mvdan changed the title docs(flag): FlagSet usage examples flag: FlagSet usage examples Dec 29, 2019
@mvdan
Copy link
Member

mvdan commented Dec 29, 2019

The example for https://golang.org/pkg/flag/#Value does use a flagset, but I agree that it's not easy to find. Sending a CL.

@gopherbot
Copy link

Change https://golang.org/cl/212757 mentions this issue: flag: add a FlagSet example

@gopherbot
Copy link

Change https://golang.org/cl/212599 mentions this issue: flag: add example for flagset

@cagedmantis cagedmantis changed the title flag: FlagSet usage examples flag: add FlagSet usage examples Dec 30, 2019
@cagedmantis cagedmantis added this to the Backlog milestone Dec 30, 2019
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 30, 2019
@cagedmantis
Copy link
Contributor

/cc @robpike

@Codinee
Copy link

Codinee commented Feb 27, 2020

I would like to work on coming up with examples for FlagSet commands usage.

@agnivade
Copy link
Contributor

@Codinee - There is already an active CL for this.

@obeyda
Copy link
Contributor Author

obeyda commented Oct 13, 2020

Any updates you can propose to this CL?

@mvdan
Copy link
Member

mvdan commented Mar 20, 2022

@obeyda note that I asked for a rebase on the CL so we can re-test and merge.

@mvdan
Copy link
Member

mvdan commented Mar 31, 2022

Friendly ping @obeyda, as someone else rebased the CL but now there's a missing import due to it. I know it's been some time, but if you can't fix up this patch so we can merge it, we should close the CL so someone else can take this.

@mvdan mvdan added NeedsFix The path to resolution is known, but the work has not been done. help wanted and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 6, 2022
@tebeka tebeka linked a pull request Nov 29, 2023 that will close this issue
@gopherbot
Copy link

Change https://go.dev/cl/545736 mentions this issue: flag: Add FlagSet example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants