Skip to content

Commit 37fed56

Browse files
tlalfanoclaudeanekkanti
authored
Disable cobra's default completion command on the cloud root (#74)
* Disable cobra's default completion command on the cloud root Cobra auto-injects a `completion` subcommand on every root command unless suppressed. The cloud plugin is invoked as `temporal cloud ...`, so shell completion belongs to the parent `temporal` CLI, not this plugin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Reword completion-disable comment to reflect actual reason The default cobra completion command needs further updates to produce working shell completions for extension subcommands; clarify that's the reason it's disabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Abhinav Nekkanti <10552725+anekkanti@users.noreply.github.com>
1 parent 410bbc3 commit 37fed56

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎temporalcloudcli/commands.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,11 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e
481481
func (c *CloudCommand) initCommand(cctx *CommandContext) {
482482
c.Command.Version = VersionString()
483483

484+
// Disable cobra's auto-injected `completion` subcommand: it needs further
485+
// updates to generate working shell completions for extension subcommands
486+
// invoked via the parent `temporal` CLI.
487+
c.Command.CompletionOptions.DisableDefaultCmd = true
488+
484489
// Set custom usage template with proper flag wrapping
485490
c.Command.SetUsageTemplate(getUsageTemplate())
486491

0 commit comments

Comments
 (0)