Skip to content

Use of obsolete v1 aliases goes undetected #1103

@TomOnTime

Description

@TomOnTime

my urfave/cli version is

2.2.0

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

There is no warning if old-style v1 aliases are used. The alias simply doesn't exist.

To reproduce

Create a flag using the v1 method:

cli.StringFlag{
  Name: "config, cfg"
}

Observed behavior

The flag --config works; --cfg does not.

Expected behavior

The system should output an error or warning.

Additional context

Ideally if Name includes a space or a comma, the code should output an
message about "Old style alias being used. Please see docs/migrate-v1-to-v2.md"
then the program should exit.

Want to fix this yourself?

no

Run go version and paste its output here

go1.14.1

Run go env and paste its output here

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qw/qp8v2j353wz7q57_jymyxj0h0000gn/T/go-build854616664=/tmp/go-build -gno-record-gcc-switches -fno-common"

Metadata

Metadata

Assignees

Labels

area/v2relates to / is being considered for v2help wantedplease help if you can!kind/bugdescribes or fixes a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions