issues.go 712 B

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "issues"
  6. "os"
  7. tea "github.com/charmbracelet/bubbletea"
  8. )
  9. func main() {
  10. flag.Parse()
  11. arg := flag.Args()
  12. if len(arg) == 0 {
  13. fmt.Println("Not enough args:", arg)
  14. os.Exit(1)
  15. }
  16. // if issues.IsIssue(arg[0]) {
  17. p := tea.NewProgram(
  18. issues.Model{Path: arg[0]},
  19. tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
  20. // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
  21. )
  22. if _, err := p.Run(); err != nil {
  23. fmt.Println("could not run program:", err)
  24. os.Exit(1)
  25. }
  26. // } else if issues.IsIssueCollection(arg[0]) {
  27. // fmt.Println("Collection of Issues:", arg)
  28. // os.Exit(0)
  29. // }
  30. }