urfave / cli

A simple, fast, and fun package for building command line apps in Go
https://cli.urfave.org
MIT License
21.91k stars 1.69k forks source link

app does not exit if called with just --help or -h #1813

Closed fnicastri closed 7 months ago

fnicastri commented 10 months ago

My urfave/cli version is

2.25.7 tested with v3-alpha4 too

Checklist

Dependency Management

Describe the bug

The app continue to run if called with the help flag (--help pr -h) after showing the help message.

To reproduce

just a bare minimum app should do

Observed behavior

The app continue to run after showing the help message

Expected behavior

The app should show the help message and exit

Run go version and paste its output here

go version go1.21.0 darwin/arm64

Run go env and paste its output here

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/frank/Library/Caches/go-build'
GOENV='/Users/frank/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/frank/src/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/frank/src/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/local/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/local/lib/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
AR='ar'
CC='/usr/bin/clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/frank/projects/EO59/development/go_salvatore/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/y3/jjt4p7t12lqfq4dtst_ycr_40000gn/T/go-build1885971844=/tmp/go-build -gno-record-gcc-switches -fno-common'
dearchap commented 9 months ago

@fnicastri Can you share the exact code that you used for this ?

fnicastri commented 9 months ago

I'm sorry but I switched to Cobra... I needed something fast and anyway was a better fit for this specific utility. Anyway I will use this project again for the smaller utils ;)

thanks for all the effort