-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
66 lines (59 loc) · 2.05 KB
/
main.go
File metadata and controls
66 lines (59 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"atlas.guide/internal/app"
)
var Version = "dev"
func main() {
if len(os.Args) > 1 {
arg := os.Args[1]
if arg == "-v" || arg == "--version" {
fmt.Printf("atlas.guide v%s\n", Version)
return
}
if arg == "-h" || arg == "--help" || arg == "help" {
showHelp()
return
}
}
m := app.NewModel()
p := tea.NewProgram(m, tea.WithAltScreen())
if _, err := p.Run(); err != nil {
fmt.Fprintf(os.Stderr, "Error running atlas.guide: %v\n", err)
os.Exit(1)
}
}
func showHelp() {
fmt.Println("Atlas Guide - A personal health and wellness tracker.")
fmt.Println()
fmt.Println("Usage:")
fmt.Println(" atlas.guide Start the interactive TUI")
fmt.Println(" atlas.guide help Show this help information")
fmt.Println(" atlas.guide --version Show version info")
fmt.Println()
fmt.Println("Tabs:")
fmt.Println(" 1 - Overview Day summary with all trackers at a glance")
fmt.Println(" 2 - Monthly Monthly aggregates and day-by-day heatmap")
fmt.Println(" 3 - Calories Track food, calorie budget, intermittent fasting")
fmt.Println(" 4 - Gym Log workouts, duration, calories burnt")
fmt.Println(" 5 - Mood Rate your day (1-5) with notes")
fmt.Println(" 6 - Medicine Track medication name & dosage")
fmt.Println(" 7 - Journal Daily journal notes")
fmt.Println()
fmt.Println("Controls:")
fmt.Println(" 1-7, Tab Switch tabs")
fmt.Println(" h/l, Left/Right Navigate days")
fmt.Println(" j/k, Up/Down Move cursor")
fmt.Println(" t Jump to today")
fmt.Println(" c Open calendar picker")
fmt.Println(" a Add entry")
fmt.Println(" d Delete entry")
fmt.Println(" g Set calorie goal (Calories tab)")
fmt.Println(" f Toggle fasting (Calories tab)")
fmt.Println(" ? Show help in TUI")
fmt.Println(" q, Ctrl+C Quit")
fmt.Println()
fmt.Println("Data is stored in ~/.atlas/atlas.guide.data/")
}