-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Setting the short: struct tag on the config element referred to by ConfigFileVariable is currently a noop. Currently the docs are unclear about this little gotcha.
E.g.: using something like:
var conf = &struct{
ConfPath string `id:"confpath" short:"c"`
}{}
gonfig.Load(&conf, gonfig.Conf{
ConfigFileVariable: "confpath",
})And then calling go run . -c /some/file will generate no errors, since the -c flag is recognized, but its value is ignored when searching the actual config file.
I suspect this is something we can work around in lookupConfigFileFlag() (maybe just naively check flagsMap[configOpt.short]?) but it just wasn't enough of an itch for me to scratch. So I'm leaving the issue here until either I get around to it, or someone else beats me to it! 😉
Cheers
Metadata
Metadata
Assignees
Labels
No labels