diff --git a/app_state.go b/app_state.go index 253936d..7d9da3b 100644 --- a/app_state.go +++ b/app_state.go @@ -205,6 +205,12 @@ func (a *AppState) initialize() { }, a.opPrintUsage, ) + a.addOperation("config", + []string{ + "config - Print or edit config", + }, + a.opConfig, + ) a.addOperation("--h", []string{ "--h - Print this message", diff --git a/timer_ops.go b/timer_ops.go index 3c8a497..f628d12 100644 --- a/timer_ops.go +++ b/timer_ops.go @@ -416,6 +416,22 @@ func (a *AppState) opFuzzyParse(args []string) int { return 0 } +func (a *AppState) opConfig(args []string) int { + if len(args) == 0 { + fmt.Println("Config Keys:") + for _, v := range a.config.GetKeyList() { + fmt.Println(" " + v) + } + } else { + if args[0] == "timerpath" { + fmt.Println(a.directory + a.fileTimer) + } else { + fmt.Println(a.config.Get(args[0])) + } + } + return 0 +} + func (a *AppState) opPrintUsage(args []string) int { for _, v := range a.ValidOperations { for _, vv := range v {