diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7423f8..d40686a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: go-version-file: go.mod - uses: golangci/golangci-lint-action@v6 with: - version: v1.62 + version: v2.0 build: strategy: diff --git a/cmd/ch/main.go b/cmd/ch/main.go index 371b009..37f1d51 100644 --- a/cmd/ch/main.go +++ b/cmd/ch/main.go @@ -17,10 +17,11 @@ var ( func main() { // Set version info for CLI - cli.Version = version + v := version if commit != "none" && len(commit) > 7 { - cli.Version = fmt.Sprintf("%s (%s, %s)", version, commit[:7], date) + v = fmt.Sprintf("%s (%s, %s)", version, commit[:7], date) } + cli.SetVersion(v) if err := cli.Execute(); err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) diff --git a/internal/cli/list.go b/internal/cli/list.go index 780582a..9593853 100644 --- a/internal/cli/list.go +++ b/internal/cli/list.go @@ -30,7 +30,7 @@ var ( ) func init() { - listCmd.Flags().BoolVarP(&listAgents, "agents", "a", true, "Include agent/subagent conversations (default: true)") + listCmd.Flags().BoolVarP(&listAgents, "agents", "a", false, "Include agent/subagent conversations") listCmd.Flags().StringVarP(&listProject, "project", "p", "", "Filter by project path") listCmd.Flags().IntVarP(&listLimit, "limit", "n", 50, "Limit number of results") listCmd.Flags().BoolVarP(&listGlobal, "global", "g", false, "List from all projects") diff --git a/internal/cli/root.go b/internal/cli/root.go index 31d6dab..fb31ec0 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -20,6 +20,13 @@ func Execute() error { return rootCmd.Execute() } +// SetVersion sets the version string for the CLI. +// Must be called before Execute() to take effect. +func SetVersion(v string) { + Version = v + rootCmd.Version = v +} + var rootCmd = &cobra.Command{ Use: "ch", Short: "Claude History - view Claude Code conversation history",