-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/bugdescribes or fixes a bugdescribes or fixes a bugstatus/triagemaintainers still need to look into thismaintainers still need to look into thisstatus/waiting-for-responseWaiting for response from original requesterWaiting for response from original requester
Milestone
Description
My urfave/cli version is
v2.24.4
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
When using App.ToMan() or App.ToMarkdown(), the generated text uses the Value of a flag no matter if DefaultText is specified or not. This makes it inconsistent to the output of the help command.
To reproduce
Include a flag like the following in your app:
&cli.StringFlag{
Name: "foo",
Value: "default value"
DefaultText: "default text"
}Observed behavior
./main help--foo (default: default text)
x, _ := App.ToMan()
fmt.Println(x)...
\fB--foo\fP="": (default: default value)
...
x, _ := App.ToMarkdown()
fmt.Println(x)...
**--foo**="": (default: default value)
....
Expected behavior
...
\fB--foo\fP="": (default: default text)
...
**--foo**="": (default: default text)
Additional context
None.
Want to fix this yourself?
If confirmed, I'd be happy to fix it.
Run go version and paste its output here
go version go1.19.6 darwin/amd64
Run go env and paste its output here
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/path/to/Library/Caches/go-build"
GOENV="/path/to/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/path/to/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/path/to/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.19.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.19.6/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19.6"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/path/to/example/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/path/to/go-build3156486010=/tmp/go-build -gno-record-gcc-switches -fno-common"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/bugdescribes or fixes a bugdescribes or fixes a bugstatus/triagemaintainers still need to look into thismaintainers still need to look into thisstatus/waiting-for-responseWaiting for response from original requesterWaiting for response from original requester