diff --git a/main.go b/main.go index 0fac8b4..4e1ef9b 100644 --- a/main.go +++ b/main.go @@ -37,7 +37,7 @@ var state *AppState var parameters []string func main() { - parameters = []string{"add", "config", "event", "defaults", "delete", "next", "refresh", "today", "ui"} + parameters = []string{"add", "config", "event", "defaults", "delete", "next", "refresh", "today", "brief", "ui"} var err error var op string state = &AppState{Name: AppName, Version: AppVersion} @@ -174,7 +174,7 @@ func main() { } fmt.Println("Couldn't find event with ID " + strconv.Itoa(evNum)) - case "today": + case "today", "brief": events := state.account.GetTodaysActiveEvents() if len(events) == 0 { fmt.Println("No Events Found") @@ -190,7 +190,11 @@ func main() { fmt.Println(err.Error()) return } - eventString := stTmStr + CalColToAnsi(*colDef).Sprint(" ") + " " + e.Summary + " " + durStr + sum := e.Summary + if op == "brief" && len(sum) > 35 { + sum = sum[:35] + "..." + } + eventString := stTmStr + CalColToAnsi(*colDef).Sprint(" ") + " " + sum + " " + durStr if hasMod("ids") { idString := "@" + strconv.Itoa(e.InstanceId) for len(idString) < 5 { @@ -398,6 +402,7 @@ func printHelp() { fmt.Println(" Event ids change such that the next upcoming event is always event 0,") fmt.Println(" the one after that is 1, the previous one is -1, etc.") fmt.Println("") + fmt.Println(" brief The same as 'today' except summaries are truncated to save space.") //fmt.Println(" ui Open galendar in UI mode") fmt.Println("") }