go-getoptions v0.18.0 Release Notes
Release Date: 2020-03-25 // about 4 years ago-
๐ As the releases before, this release has 100% test coverage.
๐ This release adds initial support for Environment Variables and adds lots of GoDoc examples.
๐ New Features
- ๐ Initial support for environment variables has been added.
๐ Currently, only
opt.String
andopt.StringVar
are supported.To use it, set the option modify function to opt.GetEnv.
For example:var profile stringopt.StringVar(&profile, "profile", "default", opt.GetEnv("AWS\_PROFILE"))
Or:
profile := opt.String("profile", "default", opt.GetEnv("AWS\_PROFILE"))
๐ NOTE: Non supported option types behave with a No-Op when
opt.GetEnv
is defined.Minor changes
๐ Change opt.Dispatch signature to clarify the actual use of the variable.
โ Additionally, actually use the variable, before it was hardcoded to "help".-func (gopt *GetOpt) Dispatch(ctx context.Context, helpOptionName string, args []string) error+func (gopt *GetOpt) Dispatch(ctx context.Context, helpCommandName string, args []string) error