MCPcopy Create free account
hub / github.com/cli/cli / attachCmd

Function attachCmd

internal/attachments/flags_test.go:19–30  ·  view source on GitHub ↗

attachCmd builds a command shaped like the ones that take --attach.

(t *testing.T, input string)

Source from the content-addressed store, hash-verified

17
18// attachCmd builds a command shaped like the ones that take --attach.
19func attachCmd(t *testing.T, input string) (*cobra.Command, *Flag) {
20 t.Helper()
21
22 cmd := &cobra.Command{Use: "comment"}
23 attachFlag := AddFlag(cmd)
24
25 argv, err := shlex.Split(input)
26 require.NoError(t, err)
27 require.NoError(t, cmd.Flags().Parse(argv))
28
29 return cmd, attachFlag
30}
31
32// Resolved through the public entry point, so a fixture is built the way a
33// command builds one.

Callers 3

TestAddFlagFunction · 0.85
TestAttachmentTelemetryFunction · 0.85
TestFlagUserAssetsFunction · 0.85

Calls 2

AddFlagFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected