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

Function attachCmd

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

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

Callers 2

TestAddFlagFunction · 0.85
TestFlagUserAssetsFunction · 0.85

Calls 2

AddFlagFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected