From 1be121813eee0fa76effd390bfb618d02f80af5b Mon Sep 17 00:00:00 2001 From: typebasedio Date: Fri, 10 Apr 2026 14:50:43 -0400 Subject: [PATCH] feat(v0.3): add --projects flag to ctask list ctask list shows tasks by default and projects with --projects. --all controls archived visibility (independent of --projects), so the four combinations work as the spec defines: - ctask list active tasks - ctask list --all active + archived tasks - ctask list --projects active projects - ctask list --projects --all active + archived projects Empty-result message reflects the active filter. --- cmd/list.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/list.go b/cmd/list.go index 4c38a96..1542d62 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -23,10 +23,12 @@ var ( listAll bool listCategory string listLimit int + listProjects bool ) func init() { listCmd.Flags().BoolVarP(&listAll, "all", "a", false, "Include archived workspaces") + listCmd.Flags().BoolVar(&listProjects, "projects", false, "Show projects instead of tasks") listCmd.Flags().StringVarP(&listCategory, "category", "c", "", "Filter by category") listCmd.Flags().IntVarP(&listLimit, "limit", "n", 20, "Maximum entries to show") rootCmd.AddCommand(listCmd) @@ -39,13 +41,18 @@ func runList(cmd *cobra.Command, args []string) error { IncludeArchived: listAll, Category: listCategory, Limit: listLimit, + Projects: listProjects, }) if err != nil { return err } if len(results) == 0 { - fmt.Println("No workspaces found.") + if listProjects { + fmt.Println("No projects found.") + } else { + fmt.Println("No tasks found.") + } return nil }