issues.go 857 B

123456789101112131415161718192021222324252627282930313233343536
  1. // TODO implement interface for browse bugs in folder
  2. //
  3. // For example:
  4. // If the user provides the path of a folder that matches spec for a bug,
  5. // just display that bug. Otherwise treat the specified path as a collection
  6. // of bugs.
  7. //
  8. // See Also:
  9. // - charmbracelet/bubbles directory and tree explorer
  10. package main
  11. import (
  12. "flag"
  13. "fmt"
  14. "issues"
  15. "os"
  16. tea "github.com/charmbracelet/bubbletea"
  17. )
  18. func main() {
  19. flag.Parse()
  20. arg := flag.Args()
  21. bug, _ := issues.Issue.NewFromPath(issues.Issue{}, arg[0])
  22. p := tea.NewProgram(
  23. issues.Model{Issue: bug},
  24. tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
  25. // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
  26. )
  27. if _, err := p.Run(); err != nil {
  28. fmt.Println("could not run program:", err)
  29. os.Exit(1)
  30. }
  31. }