attachCmd builds a command shaped like the ones that take --attach.
(t *testing.T, input string)
| 18 | |
| 19 | // attachCmd builds a command shaped like the ones that take --attach. |
| 20 | func 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. |
no test coverage detected