diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-03 23:53:25 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-03 23:53:25 +0200 |
| commit | 09b8aa9d74df0ef7d50858cd398efc8a952a1aad (patch) | |
| tree | 66b77086b1f55c349d7edb32635a52566ca70c8d /internal/cli/timer.go | |
| parent | e785973bc3a0add31a7ff68a94b9ea5d43413b59 (diff) | |
cli: thread config via command context
Diffstat (limited to 'internal/cli/timer.go')
| -rw-r--r-- | internal/cli/timer.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/cli/timer.go b/internal/cli/timer.go index 46292ad..22f1ce8 100644 --- a/internal/cli/timer.go +++ b/internal/cli/timer.go @@ -52,7 +52,7 @@ func newTimerStartCmd() *cobra.Command { if err != nil { return err } - if err := syncWorktimeWithTimer(true); err != nil { + if err := syncWorktimeWithTimer(cmd, true); err != nil { return err } return printOutput(cmd, output) @@ -69,7 +69,7 @@ func newTimerStopCmd() *cobra.Command { if err != nil { return fmt.Errorf("stop timer: %w", err) } - if err := syncWorktimeWithTimer(false); err != nil { + if err := syncWorktimeWithTimer(cmd, false); err != nil { return err } return printOutput(cmd, output) @@ -198,7 +198,7 @@ func newTimerLiveCmd() *cobra.Command { selectedFont = ascii.AllFonts[rand.IntN(len(ascii.AllFonts))] } - model, err := tuiapp.NewTimerModel(selectedFont, CurrentConfig()) + model, err := tuiapp.NewTimerModel(selectedFont, currentConfig(cmd)) if err != nil { return err } @@ -220,13 +220,13 @@ func printOutput(cmd *cobra.Command, output string) error { return err } -func syncWorktimeWithTimer(start bool) error { - cfg := CurrentConfig() +func syncWorktimeWithTimer(cmd *cobra.Command, start bool) error { + cfg := currentConfig(cmd) if !cfg.AutoWorktimeLogin { return nil } - ctx, err := resolveWorkContext() + ctx, err := resolveWorkContext(cmd) if err != nil { return err } |
