* The previous implementation had an issue with nested structures deeper
than one level. It would copy keys over instead of the expected object
structure. In the example in this commit, UnmarshalKey("clothing") was
returning "pants.size":"35" instead of "pants"{"size":"35"}
* It seems common enough that flags may be defined from PFlags be
retrieved as a sub Viper similar to getting it from Yaml or other
configuration structures. This allows flags to be bound one-to-one
with how a config file may be structured.
* This is partially based on #331 for the find boolean flag
* fixes#368
* When passing nil to BindPFlag or BindPFlags, the value is set to
a struct and passed as an interface. That struct never checks for the
flag(set) being nil. Thus, it makes sense to check before it's set to
the struct.
* fixes#422
- Don't expand user home directory for variable names that simply have a
HOME prefix;
- Support expansion of variables not followed by the path separator.
* add parsing for stringToString flags
* add logic to return flags default if not val set, add a test
* extract parsing into single func
* add a few more cases
* return nil if unable to parse instead of panicing
* return map[string]interface in order to work with cast.ToStringMap
* mostly copy pflags implementation of the conversion to a stringtostring
* Add support to save file with no extension
The support introduced for files with no file extension is only partial as trying to save the config file would fail with `<file name> requires valid extension`
This adds support to saving such files
* Only consider files without extension if the config type is explicitly specified
* Hides unused variable in test
* First check for config type then for file without extension