blob: e3b6426eca5177ee0b295f87558b9af24a011f9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package cli
import (
tuiapp "codeberg.org/snonux/timesamurai/internal/tui"
tea "github.com/charmbracelet/bubbletea"
"github.com/spf13/cobra"
)
func newTUICmd() *cobra.Command {
var disco bool
cmd := &cobra.Command{
Use: "tui",
Short: "Launch full-screen TUI",
RunE: func(cmd *cobra.Command, args []string) error {
model, err := tuiapp.NewModelWithConfigAndDisco(currentConfig(cmd), disco)
if err != nil {
return err
}
program := tea.NewProgram(model)
_, err = program.Run()
return err
},
}
cmd.Flags().BoolVar(&disco, "disco", false, "Enable disco mode (random theme changes)")
return cmd
}
|