blob: 1cc1b6bbba2141405b14456c6b0da35106c37ba1 (
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 "charm.land/bubbletea/v2"
"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
}
|