mirror of
https://github.com/cheat/cheat.git
synced 2025-09-04 11:08:29 +02:00
feat: add the --conf
command
Add the `--conf` command, which dipslay's the current `cheat` configuration file path.
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user