-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (28 loc) · 649 Bytes
/
main.go
File metadata and controls
35 lines (28 loc) · 649 Bytes
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
package main
import (
"flag"
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/ethanolivertroy/cmvp-tui/internal/tui"
)
// Version is set at build time via ldflags
var version = "dev"
func main() {
showVersion := flag.Bool("version", false, "Print version and exit")
flag.BoolVar(showVersion, "v", false, "Print version and exit (shorthand)")
flag.Parse()
if *showVersion {
fmt.Printf("cmvp %s\n", version)
return
}
p := tea.NewProgram(
tui.NewModel(),
tea.WithAltScreen(),
tea.WithMouseCellMotion(),
)
if _, err := p.Run(); err != nil {
fmt.Printf("Error running program: %v\n", err)
os.Exit(1)
}
}