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,8 +145,9 @@ func (a *AppState) initialize() {
) )
a.addOperation("switch", a.addOperation("switch",
[]string{ []string{
"switch [time] [@contexts...] [+projects...] [tag:value...] - Stops all active timers and starts a new one", "switch [time] [@contexts...] [+projects...] [tag:value...]",
" with the given arguments", " - Stops all active timers and starts a new one",
" with the given arguments",
}, },
a.opSwitchTimer, a.opSwitchTimer,
) )
@ -172,7 +173,8 @@ func (a *AppState) initialize() {
a.addOperation("mod", a.addOperation("mod",
[]string{ []string{
"mod <id> [start=<start>] [end=<end>] [projects=<project,...>] [contexts=<context,...>]", "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, a.opModifyTimer,
) )
@ -183,22 +185,30 @@ func (a *AppState) initialize() {
a.opFuzzyParse, a.opFuzzyParse,
) )
a.addOperation("--reinit", a.addOperation("--reinit",
[]string{"--reinit - Reset all Configuration Settings"}, []string{
"--reinit - Reset all Configuration Settings",
},
func(args []string) int { func(args []string) int {
a.initializeConfig() a.initializeConfig()
return 0 return 0
}, },
) )
a.addOperation("-h", a.addOperation("-h",
[]string{"-h - Print this message"}, []string{
"-h - Print this message",
},
a.opPrintUsage, a.opPrintUsage,
) )
a.addOperation("help", a.addOperation("help",
[]string{"help - Print this message"}, []string{
"help - Print this message",
},
a.opPrintUsage, a.opPrintUsage,
) )
a.addOperation("--h", a.addOperation("--h",
[]string{"--h - Print this message"}, []string{
"--h - Print this message",
},
a.opPrintUsage, a.opPrintUsage,
) )
a.directory = a.config.Get("directory") 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 _, v := range a.ValidOperations {
for _, vv := range v { for _, vv := range v {
fmt.Println(" " + vv) fmt.Println(" " + vv)
fmt.Println("")
} }
fmt.Println("")
} }
return 0 return 0
} }