Add Readme File
Fix 'refresh' function
This commit is contained in:
parent
89e317fd7b
commit
caeb987e12
13
README.md
Normal file
13
README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# galendar
|
||||
|
||||
Google Calendar CLI Client
|
||||
|
||||
In development still.
|
||||
|
||||
Current features
|
||||
|
||||
`gal [today]` - Fetch and print today's agenda for all calendars flagged as 'default'
|
||||
`gal config` - Open an interactive mode to configure the application
|
||||
`gal add <quick add text>` - Quickly add an event to your default google calendar
|
||||
`gal refresh` - Invalidate the cache then run `gal today`
|
||||
|
27
main.go
27
main.go
@ -51,22 +51,21 @@ func main() {
|
||||
|
||||
DoVersionCheck()
|
||||
|
||||
for i := range os.Args {
|
||||
switch os.Args[i] {
|
||||
case "--reinit":
|
||||
// Reset all config
|
||||
for _, v := range state.cfg.GetKeyList() {
|
||||
fmt.Println("Deleting Key: " + v)
|
||||
state.cfg.DeleteKey(v)
|
||||
}
|
||||
case "--refresh":
|
||||
|
||||
case "-r":
|
||||
|
||||
if op == "refresh" {
|
||||
// Invalidate Cache, then just do a 'today'
|
||||
if err = state.cfg.SetDateTime("calListUseBy", time.Now()); err != nil {
|
||||
fmt.Println("cahceInvalidate error:", err)
|
||||
}
|
||||
op = "today"
|
||||
}
|
||||
|
||||
switch op {
|
||||
case "--reinit":
|
||||
// Reset all config
|
||||
for _, v := range state.cfg.GetKeyList() {
|
||||
fmt.Println("Deleting Key: " + v)
|
||||
state.cfg.DeleteKey(v)
|
||||
}
|
||||
case "today":
|
||||
// Show everything on the calendar for today
|
||||
InitComm()
|
||||
@ -121,6 +120,10 @@ func main() {
|
||||
fmt.Println(err.Error())
|
||||
} else {
|
||||
fmt.Println(e.ToCLIString())
|
||||
// Invalidate the cache
|
||||
if err = state.cfg.SetDateTime("calListUseBy", time.Now()); err != nil {
|
||||
fmt.Println("cahceInvalidate error:", err)
|
||||
}
|
||||
}
|
||||
case "bail":
|
||||
// Just initialize communications and bail
|
||||
|
Loading…
Reference in New Issue
Block a user