issues.go 831 B

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