chore: repo skeleton + cobra root with day stub
233f44da161408083163940bf60d20f87241a954
humdrum-tiv <45084903+humdrum-tiv@users.noreply.github.com> · 2026-07-07 16:30
5 files changed
.gitignore +0 −1
@@ -1 +0,0 @@
-bin/
cmd/ticktock/main.go +0 −36
@@ -1,36 +0,0 @@
-package main
-
-import (
- "fmt"
- "os"
-
- "github.com/spf13/cobra"
-)
-
-func newRootCmd() *cobra.Command {
- root := &cobra.Command{
- Use: "ticktock",
- Short: "Charm-native front-end for the tock time tracker",
- }
- root.AddCommand(newDayCmd())
- return root
-}
-
-// newDayCmd is stubbed here and wired to the TUI in Task 5.
-func newDayCmd() *cobra.Command {
- return &cobra.Command{
- Use: "day [date|today|yesterday]",
- Short: "Review and edit a day's tock entries",
- Args: cobra.MaximumNArgs(1),
- RunE: func(cmd *cobra.Command, args []string) error {
- return fmt.Errorf("day: not wired yet")
- },
- }
-}
-
-func main() {
- if err := newRootCmd().Execute(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
cmd/ticktock/main_test.go +0 −22
@@ -1,22 +0,0 @@
-package main
-
-import "testing"
-
-func TestRootHasDayCommand(t *testing.T) {
- root := newRootCmd()
- var found bool
- for _, c := range root.Commands() {
- if c.Name() == "day" {
- found = true
- }
- }
- if !found {
- t.Fatalf("root command is missing the 'day' subcommand")
- }
-}
-
-func TestRootUse(t *testing.T) {
- if got := newRootCmd().Use; got != "ticktock" {
- t.Fatalf("root Use = %q, want %q", got, "ticktock")
- }
-}
go.mod +0 −10
@@ -1,10 +0,0 @@
-module ticktock
-
-go 1.26.4
-
-require github.com/spf13/cobra v1.10.2
-
-require (
- github.com/inconshreveable/mousetrap v1.1.0 // indirect
- github.com/spf13/pflag v1.0.9 // indirect
-)
go.sum +0 −10
@@ -1,10 +0,0 @@
-github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
-github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
-github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
-github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
-github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
-github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=