conf icon indicating copy to clipboard operation
conf copied to clipboard

Special case the "version" string

Open kevinburkesegment opened this issue 3 years ago • 0 comments

We have a config that looks like e.g.

type config struct {
	Version         bool   `conf:"version" help:"Print the program version and exit."`
	S3Bucket        string `conf:"s3-bucket" help:"The S3 bucket to deliver logs batches to." validate:"nonzero"`
}

If you run ./myprogram --version you get the following error:

Error:
  invalid value passed to s3-bucket: zero value

Instead I expect to see the version number printed out. I'm not sure what the right approach would be.

kevinburkesegment avatar May 06 '22 05:05 kevinburkesegment