(t *testing.T)
| 1179 | } |
| 1180 | |
| 1181 | func TestCommand_SkipFlagParsing(t *testing.T) { |
| 1182 | var args Args |
| 1183 | |
| 1184 | cmd := &Command{ |
| 1185 | SkipFlagParsing: true, |
| 1186 | Action: func(_ context.Context, cmd *Command) error { |
| 1187 | args = cmd.Args() |
| 1188 | return nil |
| 1189 | }, |
| 1190 | } |
| 1191 | |
| 1192 | _ = cmd.Run(buildTestContext(t), []string{"", "--", "my-arg", "notAFlagAtAll"}) |
| 1193 | |
| 1194 | assert.NotNil(t, args) |
| 1195 | assert.Equal(t, "--", args.Get(0)) |
| 1196 | assert.Equal(t, "my-arg", args.Get(1)) |
| 1197 | assert.Equal(t, "notAFlagAtAll", args.Get(2)) |
| 1198 | } |
| 1199 | |
| 1200 | func TestCommand_VisibleCommands(t *testing.T) { |
| 1201 | cmd := &Command{ |
nothing calls this directly
no test coverage detected