MCPcopy Create free account
hub / github.com/github/gh-aw / findSubcommand

Function findSubcommand

pkg/cli/completion_command_test.go:147–154  ·  view source on GitHub ↗

Helper function to find a subcommand by name

(cmd *cobra.Command, name string)

Source from the content-addressed store, hash-verified

145
146// Helper function to find a subcommand by name
147func findSubcommand(cmd *cobra.Command, name string) *cobra.Command {
148 for _, subCmd := range cmd.Commands() {
149 if subCmd.Name() == name {
150 return subCmd
151 }
152 }
153 return nil
154}
155
156// TestCompletionCommand_BashScriptFormat verifies bash completion can be generated
157func TestCompletionCommand_BashScriptFormat(t *testing.T) {

Calls

no outgoing calls

Tested by

no test coverage detected