Closed bartekpacia closed 2 months ago
v2.27.1
My project is using Go modules.
My program called emu is built with this great module. Let's say emu has the following commands:
emu
kill
run
list
The list command also has an alias ls.
ls
The problem is that both list and ls are shown in shell completion ("TAB completion"), which doesn't make much sense and is annoying:
https://github.com/urfave/cli/assets/40357511/ce917534-c111-4b49-a777-14f2d469e58f
Aliases are not shown in shell completion. This is how huge, popular CLI projects like gh or docker do it:
gh
docker
$ docker image list --help Usage: docker image ls [OPTIONS] [REPOSITORY[:TAG]] List images Aliases: docker image ls, docker image list, docker images ... <omitted>
https://github.com/urfave/cli/assets/40357511/632e9b65-4502-4ad6-a65f-e5b35eb79956
(in Docker's case, ls is the main command and list is an alias - so my point is still valid).
Sure!
go version
go version go1.22.1 darwin/arm64
go env
GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/bartek/Library/Caches/go-build' GOENV='/Users/bartek/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/bartek/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='darwin' GOPATH='/Users/bartek/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/opt/homebrew/Cellar/go/1.22.1/libexec' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.1/libexec/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.22.1' GCCGO='gccgo' AR='ar' CC='cc' CXX='c++' CGO_ENABLED='1' GOMOD='/Users/bartek/projects/emu/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/r6/5z0bypqn4cb8p369zlrfhw3c0000gn/T/go-build1695057898=/tmp/go-build -gno-record-gcc-switches -fno-common'
This is not really a bug as much as it is a desired behaviour.
Can we mark it as v3 instead of v2 and not as bug but as "change/feature" requst?
v3
v2
My urfave/cli version is
v2.27.1
Checklist
Dependency Management
My project is using Go modules.
Describe the bug
My program called
emu
is built with this great module. Let's sayemu
has the following commands:kill
run
list
The
list
command also has an aliasls
.The problem is that both
list
andls
are shown in shell completion ("TAB completion"), which doesn't make much sense and is annoying:https://github.com/urfave/cli/assets/40357511/ce917534-c111-4b49-a777-14f2d469e58f
To reproduce wrong behavior
Expected behavior
Aliases are not shown in shell completion. This is how huge, popular CLI projects like
gh
ordocker
do it:https://github.com/urfave/cli/assets/40357511/632e9b65-4502-4ad6-a65f-e5b35eb79956
(in Docker's case,
ls
is the main command andlist
is an alias - so my point is still valid).Want to fix this yourself?
Sure!
Run
go version
and paste its output hereRun
go env
and paste its output here