mirror of
https://github.com/shokinn/hosts-go.git
synced 2025-08-23 08:33:02 +00:00
22 lines
402 B
Go
22 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"hosts-go/internal/core"
|
|
"hosts-go/internal/tui"
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
func main() {
|
|
hostsFile, _, err := core.ParseHostsFile("/etc/hosts")
|
|
if err != nil {
|
|
log.Fatalf("failed to parse hosts file: %v", err)
|
|
}
|
|
|
|
p := tea.NewProgram(tui.NewModel(hostsFile))
|
|
if err := p.Start(); err != nil {
|
|
log.Fatalf("failed to start TUI: %v", err)
|
|
}
|
|
}
|