feat: add the --conf command

Add the `--conf` command, which dipslay's the current `cheat`
configuration file path.
This commit is contained in:
Christopher Allen Lane
2022-08-07 14:08:25 -04:00
parent d598d96fce
commit ddbe710881
5 changed files with 26 additions and 0 deletions

View File

@ -20,6 +20,7 @@ type Config struct {
Style string `yaml:"style"`
Formatter string `yaml:"formatter"`
Pager string `yaml:"pager"`
Path string
}
// New returns a new Config struct
@ -34,6 +35,9 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er
// initialize a config object
conf := Config{}
// store the config path
conf.Path = confPath
// unmarshal the yaml
err = yaml.UnmarshalStrict(buf, &conf)
if err != nil {