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

Function attachCmd

internal/attachments/flags_test.go:20–31  ·  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

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

Callers 3

TestAddFlagFunction · 0.85
TestFlagRecordTelemetryFunction · 0.85
TestFlagUserAssetsFunction · 0.85

Calls 2

AddFlagFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected