issues.go 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. if len(arg) == 0 {
  22. fmt.Println("Not enough args:", arg)
  23. os.Exit(1)
  24. }
  25. issue, _ := issues.Issue.NewFromPath(issues.Issue{}, arg[0])
  26. p := tea.NewProgram(
  27. issues.Model{Issue: issue},
  28. tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
  29. // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
  30. )
  31. if _, err := p.Run(); err != nil {
  32. fmt.Println("could not run program:", err)
  33. os.Exit(1)
  34. }
  35. }