aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-06-25 09:23:51 +0200
committerDrew DeVault <sir@cmpwn.com>2019-06-25 10:38:52 -0400
commitee242a3d0ffc4d9cca884a2ad9047cdd16cd713e (patch)
tree65c955b212198b6346bf88e00d0ebf199c6578fd /config
parent61c94e54cd6da2e2989c252ca0b3cc7756b1ef65 (diff)
add DefaultSavePath config
Diffstat (limited to 'config')
-rw-r--r--config/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 9295a1d..8028224 100644
--- a/config/config.go
+++ b/config/config.go
@@ -18,6 +18,10 @@ import (
"github.com/kyoh86/xdg"
)
+type GeneralConfig struct {
+ DefaultSavePath string `ini:"default-save-path"`
+}
+
type UIConfig struct {
IndexFormat string `ini:"index-format"`
TimestampFormat string `ini:"timestamp-format"`
@@ -85,6 +89,7 @@ type AercConfig struct {
Filters []FilterConfig `ini:"-"`
Viewer ViewerConfig `ini:"-"`
Ui UIConfig
+ General GeneralConfig
}
// Input: TimestampFormat
@@ -319,6 +324,11 @@ func LoadConfig(root *string, sharedir string) (*AercConfig, error) {
return nil, err
}
}
+ if ui, err := file.GetSection("general"); err == nil {
+ if err := ui.MapTo(&config.General); err != nil {
+ return nil, err
+ }
+ }
accountsPath := path.Join(*root, "accounts.conf")
if accounts, err := loadAccountConfig(accountsPath); err != nil {
return nil, err