Initial commit for i0T.app and migration here with a fresh repo
This commit is contained in:
30
go/cmd/printcontrol/main.go
Normal file
30
go/cmd/printcontrol/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
"github.com/lwoodard/printcontrol/internal/tui"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := flag.String("port", "", "Serial port (auto-detected if empty)")
|
||||
baud := flag.Int("baud", 0, "Baud rate (0 = auto-detect)")
|
||||
noConnect := flag.Bool("no-connect", false, "Don't auto-connect on launch")
|
||||
flag.Parse()
|
||||
|
||||
m := tui.New(tui.Config{
|
||||
Port: *port,
|
||||
Baud: *baud,
|
||||
AutoConnect: !*noConnect,
|
||||
})
|
||||
|
||||
p := tea.NewProgram(m, tea.WithAltScreen())
|
||||
if _, err := p.Run(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "printcontrol:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user