feat(v0.5.2): direct lookup includes archived; resume hint for archived

Apply the v0.5.2 lookup policy to the existing commands and wire
ValidArgsFunction hooks across the workspace-accepting surface.

info: drop the --all/-a flag entirely. Direct lookup is now
archived-inclusive by default — the user typed a name, so we find
the workspace and surface its status in the output. The Status
line already distinguishes active vs archived clearly.

resume: when targeting an archived workspace, fail with a useful
hint instead of letting the resolver report "not found":

  [ctask] error: workspace "X" is archived

  To restore it:
    ctask restore X

This is implemented by resolving archived-inclusive and rejecting
status==archived before any session-launch logic runs. Genuine
not-found and ambiguous-match behavior are unchanged.

Adds ValidArgsFunction hooks to archive (active), delete (active),
open (active), info (any), resume (active). Restore/notes/path
already have hooks from the previous commit. Shell completion now
covers the full direct-lookup surface.
This commit is contained in:
2026-05-07 19:47:24 -04:00
parent 176e788f67
commit b923ae8892
7 changed files with 142 additions and 9 deletions
+4
View File
@@ -28,6 +28,10 @@ var (
func init() {
deleteCmd.Flags().BoolVarP(&deleteForce, "force", "f", false, "Skip confirmation prompt")
deleteCmd.Flags().BoolVarP(&deleteAll, "all", "a", false, "Include archived workspaces in query resolution")
// v0.5.2: completion offers active candidates only. Users with `--all`
// can still type the archived name explicitly; flag-aware completion is
// deferred until there's a real need.
deleteCmd.ValidArgsFunction = completeWorkspaces(completionActive)
rootCmd.AddCommand(deleteCmd)
}