Print config stuff
This commit is contained in:
parent
1c2d186843
commit
d456c2c6c3
@ -205,6 +205,12 @@ func (a *AppState) initialize() {
|
|||||||
},
|
},
|
||||||
a.opPrintUsage,
|
a.opPrintUsage,
|
||||||
)
|
)
|
||||||
|
a.addOperation("config",
|
||||||
|
[]string{
|
||||||
|
"config - Print or edit config",
|
||||||
|
},
|
||||||
|
a.opConfig,
|
||||||
|
)
|
||||||
a.addOperation("--h",
|
a.addOperation("--h",
|
||||||
[]string{
|
[]string{
|
||||||
"--h - Print this message",
|
"--h - Print this message",
|
||||||
|
16
timer_ops.go
16
timer_ops.go
@ -416,6 +416,22 @@ func (a *AppState) opFuzzyParse(args []string) int {
|
|||||||
return 0
|
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 {
|
func (a *AppState) opPrintUsage(args []string) int {
|
||||||
for _, v := range a.ValidOperations {
|
for _, v := range a.ValidOperations {
|
||||||
for _, vv := range v {
|
for _, vv := range v {
|
||||||
|
Loading…
Reference in New Issue
Block a user