| 123456789101112131415161718192021222324252627282930313233343536373839 |
- // TODO(main): set chart height by user flag
- // TODO(main): determine chart heights dynamically by number of addresses
- package main
- import (
- "flag"
- "fmt"
- "os"
- "pingo/internal/tui"
- "time"
- tea "github.com/charmbracelet/bubbletea"
- )
- func main() {
- speed := flag.Int("s", 80, "the speed with which the UI runs")
- flag.Parse()
- hosts := flag.Args()
- if len(hosts) == 0 {
- fmt.Println("Must specify hosts!")
- return
- }
- var model = tui.InitialModel( // TODO(argv) set args via argv
- // []string{"doesntresolve.comdoasdf", "google.ca"},
- hosts, time.Duration(*speed),
- )
- p := tea.NewProgram(model,
- tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
- // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
- )
- if _, err := p.Run(); err != nil {
- fmt.Printf("Alas, there's been an error: %v", err)
- os.Exit(1)
- }
- }
|