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

Categories with no visible flags are still visible #1860

Closed
kckrinke opened this issue Jan 21, 2024 · 1 comment · Fixed by #1869
Closed

Categories with no visible flags are still visible #1860

kckrinke opened this issue Jan 21, 2024 · 1 comment · Fixed by #1869
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this

Comments

@kckrinke
Copy link

My urfave/cli version is

v2.27.1

Checklist

  • [*] Are you running the latest v2 release? The list of releases is here.
  • [*] Did you check the manual for your release? The v2 manual is here
  • [*] Did you perform a search about this problem? Here's the GitHub guide about searching.

Dependency Management

  • My project is using go modules.

Describe the bug

Categories with no visible flags are still visible in the --help text output.

To reproduce

  • Create a hidden flag with a unique category name and add it to the cli.App.
  • Build the app and run with the --help flag.

Observed behavior

  • The unique category name is visible even though there are no flags presented in the category

Expected behavior

  • The unique category name is not visible in the --help output

Additional context

Nothing special.

Want to fix this yourself?

I've worked around this problem in my own projects and I don't know enough about the codebase (v2 and v3) to know if this is an easy fix or not.

Run go version and paste its output here

go version go1.21.5 linux/arm64

Run go env and paste its output here

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/pruned/golang/cache'
GOENV='/pruned/golang/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS='-modcacherw'
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/pruned/golang/modcache'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/quo'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/pruned/golang/go'
GOSUMDB='sum.golang.org'
GOTMPDIR='/pruned/golang/tmp'
GOTOOLCHAIN='auto'
GOTOOLDIR='/pruned/golang/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/pruned/project/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/pruned/golang/tmp/go-build2354014409=/tmp/go-build -gno-record-gcc-switches'
@kckrinke kckrinke added area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this labels Jan 21, 2024
@sverdlov93
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants