02enum

command
v0.0.0-...-73a1975 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 4 Imported by: 0

README

02enum/

enum example

go run 02enum/main.go --log-level DEBUG --log-level2 warn
parsed: &main.Options{Name:"foo", LogLevel:"DEBUG", LogLevel2:(*main.LogLevel)(0xc000098600)}


$ go run 02enum/main.go --log-level foo --log-level2 foo
invalid argument "foo" for "--log-level" flag: FOO is an invalid value for main.LogLevel
Usage of hello:
      --log-level LogLevel    ENV: X_LOG_LEVEL	log level {DEBUG, INFO, WARN, ERROR} (default INFO)
      --log-level2 LogLevel   ENV: X_LOG_LEVEL2	log level {DEBUG, INFO, WARN, ERROR} (default INFO)
      --name string           ENV: X_NAME	name of greeting (default "foo")
invalid argument "foo" for "--log-level" flag: FOO is an invalid value for main.LogLevel
exit status 2

more simplified definition with TextVar is here

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL