Fix gt hook --json flag not working
The --json flag was only registered on the status subcommand, not the parent hook command. When running `gt hook --json` (no args), it would fail with "unknown flag". Now the flag is registered on both. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
58a7615801
commit
e539ea3cc8
@@ -63,12 +63,14 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
// Flags for attaching work (gt hook <bead-id>)
|
||||||
hookCmd.Flags().StringVarP(&hookSubject, "subject", "s", "", "Subject for handoff mail (optional)")
|
hookCmd.Flags().StringVarP(&hookSubject, "subject", "s", "", "Subject for handoff mail (optional)")
|
||||||
hookCmd.Flags().StringVarP(&hookMessage, "message", "m", "", "Message for handoff mail (optional)")
|
hookCmd.Flags().StringVarP(&hookMessage, "message", "m", "", "Message for handoff mail (optional)")
|
||||||
hookCmd.Flags().BoolVarP(&hookDryRun, "dry-run", "n", false, "Show what would be done")
|
hookCmd.Flags().BoolVarP(&hookDryRun, "dry-run", "n", false, "Show what would be done")
|
||||||
hookCmd.Flags().BoolVarP(&hookForce, "force", "f", false, "Replace existing incomplete pinned bead")
|
hookCmd.Flags().BoolVarP(&hookForce, "force", "f", false, "Replace existing incomplete pinned bead")
|
||||||
|
|
||||||
// Add status subcommand (shares --json flag with mol status)
|
// --json flag for status output (used when no args, i.e., gt hook --json)
|
||||||
|
hookCmd.Flags().BoolVar(&moleculeJSON, "json", false, "Output as JSON (for status)")
|
||||||
hookStatusCmd.Flags().BoolVar(&moleculeJSON, "json", false, "Output as JSON")
|
hookStatusCmd.Flags().BoolVar(&moleculeJSON, "json", false, "Output as JSON")
|
||||||
hookCmd.AddCommand(hookStatusCmd)
|
hookCmd.AddCommand(hookStatusCmd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user