-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (31 loc) · 671 Bytes
/
main.go
File metadata and controls
38 lines (31 loc) · 671 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
36
37
38
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/quasar/mctui/internal/app"
)
var version = "dev"
func main() {
// Handle flags
if len(os.Args) > 1 {
switch os.Args[1] {
case "--version", "-v", "version":
fmt.Printf("mctui %s\n", version)
return
}
}
// Initialize the app
model := app.New()
// Create the Bubbletea program
p := tea.NewProgram(
model,
tea.WithAltScreen(), // Use alternate screen buffer
tea.WithMouseCellMotion(), // Enable mouse support
)
// Run the program
if _, err := p.Run(); err != nil {
fmt.Fprintf(os.Stderr, "Error running program: %v\n", err)
os.Exit(1)
}
}