alecthomas / alecthomas/kingpin

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

Aperta
#261 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
3.6k
Fork
279
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.