Clean up usage messages.

This commit is contained in:
Brian Buller 2019-05-01 09:11:06 -05:00
parent dd3da921e9
commit 1c2d186843
2 changed files with 18 additions and 8 deletions

View File

@ -145,7 +145,8 @@ func (a *AppState) initialize() {
)
a.addOperation("switch",
[]string{
"switch [time] [@contexts...] [+projects...] [tag:value...] - Stops all active timers and starts a new one",
"switch [time] [@contexts...] [+projects...] [tag:value...]",
" - Stops all active timers and starts a new one",
" with the given arguments",
},
a.opSwitchTimer,
@ -172,7 +173,8 @@ func (a *AppState) initialize() {
a.addOperation("mod",
[]string{
"mod <id> [start=<start>] [end=<end>] [projects=<project,...>] [contexts=<context,...>]",
" - Prints the status of all active timers",
" - Modify timer with id <id> changes are absolute, so, e.g., if you pass a",
" 'projects' tag, the projects on the timer will be replaced with the value",
},
a.opModifyTimer,
)
@ -183,22 +185,30 @@ func (a *AppState) initialize() {
a.opFuzzyParse,
)
a.addOperation("--reinit",
[]string{"--reinit - Reset all Configuration Settings"},
[]string{
"--reinit - Reset all Configuration Settings",
},
func(args []string) int {
a.initializeConfig()
return 0
},
)
a.addOperation("-h",
[]string{"-h - Print this message"},
[]string{
"-h - Print this message",
},
a.opPrintUsage,
)
a.addOperation("help",
[]string{"help - Print this message"},
[]string{
"help - Print this message",
},
a.opPrintUsage,
)
a.addOperation("--h",
[]string{"--h - Print this message"},
[]string{
"--h - Print this message",
},
a.opPrintUsage,
)
a.directory = a.config.Get("directory")

View File

@ -420,8 +420,8 @@ func (a *AppState) opPrintUsage(args []string) int {
for _, v := range a.ValidOperations {
for _, vv := range v {
fmt.Println(" " + vv)
fmt.Println("")
}
fmt.Println("")
}
return 0
}