|
@@ -27,15 +27,22 @@ func main() {
|
|
|
os.Exit(1)
|
|
os.Exit(1)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- issue, _ := issues.Issue.NewFromPath(issues.Issue{}, arg[0])
|
|
|
|
|
- p := tea.NewProgram(
|
|
|
|
|
- issues.Model{Issue: issue},
|
|
|
|
|
- tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
|
|
|
|
|
- // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ isIssue, _ := issues.IsIssue(arg[0])
|
|
|
|
|
+ if isIssue {
|
|
|
|
|
+ issue, err := issues.Issue.NewFromPath(issues.Issue{}, arg[0])
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ fmt.Println("could not load issue:", err)
|
|
|
|
|
+ os.Exit(1)
|
|
|
|
|
+ }
|
|
|
|
|
+ p := tea.NewProgram(
|
|
|
|
|
+ issues.Model{Issue: issue},
|
|
|
|
|
+ tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"
|
|
|
|
|
+ // tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
- if _, err := p.Run(); err != nil {
|
|
|
|
|
- fmt.Println("could not run program:", err)
|
|
|
|
|
- os.Exit(1)
|
|
|
|
|
|
|
+ if _, err := p.Run(); err != nil {
|
|
|
|
|
+ fmt.Println("could not run program:", err)
|
|
|
|
|
+ os.Exit(1)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|