alecthomas / alecthomas/kingpin

ExistingDir() still checked when program run with --version

Offen
#261 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
3.6k
Forks
279
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

When using `kingpin.Version("...")`, passing `--version` means `.Required()` arguments do not have to be provided. I have an argument with a `.Default()` that must be an `.ExistingDir()`. The default path does not exist on the system. When passing only `--version`, I get an error that the default directory doesn't exist, rather than the version. Passing `--version --help` means the version is printed correctly.

It would be very useful if kingpin did not check that `.ExistingDir()`s actually existed if the program is run with only the `--version` flag.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.