Skip to content

Commit

Permalink
better logs and conf output
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoKats committed Aug 15, 2024
1 parent bea2830 commit cb0bb07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ func ReadConfig() (Config, error) {
}
return config, nil
}
return config, errors.New("Config file not found.")
return config, errors.New("Config file not found. Please add it at ~/.mdrss/config.json")
}

12 changes: 11 additions & 1 deletion mdrss.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
mdrss "github.com/TimoKats/mdrss/lib"
"reflect"
"errors"
"os"
)
Expand Down Expand Up @@ -31,7 +32,16 @@ func updateCommand(config mdrss.Config) error {
}

func confCommand(config mdrss.Config) error {
mdrss.Info.Printf("%#v\n", config)
configValues := reflect.ValueOf(config)
typeOfS := configValues.Type()
mdrss.Info.Println("MDRSS v1.0.0 by Timo Kats")
for i := 0; i < configValues.NumField(); i++ {
if len(typeOfS.Field(i).Name) < 8 {
mdrss.Info.Printf("%s\t\t%v\n", typeOfS.Field(i).Name, configValues.Field(i).Interface())
} else {
mdrss.Info.Printf("%s\t%v\n", typeOfS.Field(i).Name, configValues.Field(i).Interface())
}
}
return nil
}

Expand Down

0 comments on commit cb0bb07

Please sign in to comment.