cli: String flag cannot be set to "-1"

my urfave/cli version is

v1.22.1, v1.22.2, v1.22.3 (broken since v1.22.2)

Checklist

  • Are you running the latest v1 release? The list of releases is here.
  • Did you check the manual for your release? The v1 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.
  • My project is using vendoring.
  • My project is automatically downloading the latest version.
  • I am unsure of what my dependency management setup is.

Describe the bug

This flag can be set to “-1” on v1.22.1 but cannot be set since v1.22.2.

		cli.StringFlag{
			Name:  "memory-swap",
			Usage: "Total memory usage (memory + swap); set '-1' to enable unlimited swap",
		},

https://github.com/opencontainers/runc/blob/be51398a8af0b32b0b580e4da069cc6f704639bf/update.go#L111-L114

Regression in https://github.com/urfave/cli/compare/v1.22.1...v1.22.2

To reproduce

Specify urfave/cli version in go.mod in the runc tree, run go mod tidy, go mod vendor, and make integration.

Observed behavior

# runc update test_update --memory-swap -1 (status=1):
# Incorrect Usage: flag provided but not defined: -1

Expected behavior

It should not fail.

Additional context

https://github.com/opencontainers/runc/pull/2268#issuecomment-603444767

Run go version and paste its output here

For vendoring:

go version go1.14.1 linux/amd64

For running the containerized test suite:

go version go1.12.17 linux/amd64

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Is this library still alive?