From dbdf47c37af1858e856c3fa0c0aab48a14f896c6 Mon Sep 17 00:00:00 2001 From: rictus Date: Thu, 1 Jan 2026 19:25:21 -0800 Subject: [PATCH] fix(convoy): Make --notify flag work without argument (gt-qs8ur) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use NoOptDefVal so --notify defaults to "mayor/" when specified without a value: - `--notify` (no arg) -> defaults to "mayor/" - `--notify ops/` -> uses "ops/" - (no flag) -> no notification Removed the mayor-specific auto-default since NoOptDefVal handles this for all roles. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/convoy.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/internal/cmd/convoy.go b/internal/cmd/convoy.go index 66842459..f42381da 100644 --- a/internal/cmd/convoy.go +++ b/internal/cmd/convoy.go @@ -86,7 +86,8 @@ issues across any rig. Examples: gt convoy create "Deploy v2.0" gt-abc bd-xyz - gt convoy create "Release prep" gt-abc --notify mayor/ + gt convoy create "Release prep" gt-abc --notify # defaults to mayor/ + gt convoy create "Release prep" gt-abc --notify ops/ # notify ops/ gt convoy create "Feature rollout" gt-a gt-b gt-c --molecule mol-release`, Args: cobra.MinimumNArgs(1), RunE: runConvoyCreate, @@ -133,7 +134,8 @@ Examples: func init() { // Create flags convoyCreateCmd.Flags().StringVar(&convoyMolecule, "molecule", "", "Associated molecule ID") - convoyCreateCmd.Flags().StringVar(&convoyNotify, "notify", "", "Address to notify on completion") + convoyCreateCmd.Flags().StringVar(&convoyNotify, "notify", "", "Address to notify on completion (default: mayor/ if flag used without value)") + convoyCreateCmd.Flags().Lookup("notify").NoOptDefVal = "mayor/" // Status flags convoyStatusCmd.Flags().BoolVar(&convoyStatusJSON, "json", false, "Output as JSON") @@ -173,13 +175,6 @@ func runConvoyCreate(cmd *cobra.Command, args []string) error { return err } - // Default --notify to mayor/ when mayor creates a convoy - if convoyNotify == "" { - if roleInfo, err := GetRole(); err == nil && roleInfo.Role == RoleMayor { - convoyNotify = "mayor/" - } - } - // Create convoy issue in town beads description := fmt.Sprintf("Convoy tracking %d issues", len(trackedIssues)) if convoyNotify != "" {