|
|
@ -4,6 +4,7 @@ package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"os" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/pelletier/go-toml" |
|
|
|
"github.com/pelletier/go-toml" |
|
|
@ -67,7 +68,12 @@ func cmdSet(cmd []string) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
func loadFromToml() { |
|
|
|
func loadFromToml() { |
|
|
|
config, err := toml.LoadFile("kbtui.tml") |
|
|
|
configFile, env := os.LookupEnv("KBTUI_CFG") |
|
|
|
|
|
|
|
if !env { |
|
|
|
|
|
|
|
configFile = "kbtui.toml" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config, err := toml.LoadFile(configFile) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
printError(fmt.Sprintf("Could not read config file: %+v", err)) |
|
|
|
printError(fmt.Sprintf("Could not read config file: %+v", err)) |
|
|
|
return |
|
|
|
return |
|
|
|