deprecate(polecat): add migration warning to gt polecat add

Add deprecation warning pointing users to 'gt polecat identity add':
- Cobra Deprecated field emits automatic warning on command use
- Custom warning in runPolecatAdd for prominent stderr output
- Updated help text with deprecation notice and new command example

The command still functions but will be removed in v1.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
furiosa
2026-01-11 21:17:58 -08:00
committed by beads/crew/emma
parent c7e1b207df
commit 8ed31e9634

View File

@@ -59,15 +59,19 @@ Examples:
}
var polecatAddCmd = &cobra.Command{
Use: "add <rig> <name>",
Short: "Add a new polecat to a rig",
Use: "add <rig> <name>",
Short: "Add a new polecat to a rig (DEPRECATED)",
Deprecated: "use 'gt polecat identity add' instead. This command will be removed in v1.0.",
Long: `Add a new polecat to a rig.
DEPRECATED: Use 'gt polecat identity add' instead. This command will be removed in v1.0.
Creates a polecat directory, clones the rig repo, creates a work branch,
and initializes state.
Example:
gt polecat add greenplace Toast`,
gt polecat identity add greenplace Toast # Preferred
gt polecat add greenplace Toast # Deprecated`,
Args: cobra.ExactArgs(2),
RunE: runPolecatAdd,
}
@@ -426,6 +430,11 @@ func runPolecatList(cmd *cobra.Command, args []string) error {
}
func runPolecatAdd(cmd *cobra.Command, args []string) error {
// Emit deprecation warning
fmt.Fprintf(os.Stderr, "%s 'gt polecat add' is deprecated. Use 'gt polecat identity add' instead.\n",
style.Warning.Render("Warning:"))
fmt.Fprintf(os.Stderr, " This command will be removed in v1.0.\n\n")
rigName := args[0]
polecatName := args[1]