issues.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. // if issues.IsIssue(arg[0]) {
  26. p := tea.NewProgram(
  27. issues.Model{Path: arg[0]},
  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. // } else if issues.IsIssueCollection(arg[0]) {
  36. // fmt.Println("Collection of Issues:", arg)
  37. // os.Exit(0)
  38. // }
  39. }