{"record":{"id":"43c2f4a598d7b485","repo":"slimtoolkit/slim","slug":"not-enough-image-references","errorCode":null,"errorMessage":"not enough image references","messagePattern":"not enough image references","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/command/merge/cli.go","lineNumber":96,"sourceCode":"\t\tvalues.FirstImage = images[0]\n\t\tvalues.LastImage = images[1]\n\t}\n\n\tif ctx.Args().Len() > 0 {\n\t\tif ctx.Args().Len() < 2 {\n\t\t\txc.Out.Error(\"param.image\", \"must have two image references\")\n\t\t\tcli.ShowCommandHelp(ctx, Name)\n\t\t\treturn nil, fmt.Errorf(\"must have two image references\")\n\t\t}\n\n\t\tvalues.FirstImage = ctx.Args().Get(0)\n\t\tvalues.LastImage = ctx.Args().Get(1)\n\t}\n\n\tif values.FirstImage == \"\" || values.LastImage == \"\" {\n\t\txc.Out.Error(\"param.image\", \"not enough image references\")\n\t\tcli.ShowCommandHelp(ctx, Name)\n\t\treturn nil, fmt.Errorf(\"not enough image references\")\n\t}\n\n\treturn values, nil\n}\n","sourceCodeStart":78,"sourceCodeEnd":101,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/command/merge/cli.go#L78-L101","documentation":"Final validation in CommandFlagValues: after checking flags and args, if either FirstImage or LastImage is still empty, the command fails with 'not enough image references'. This catches the case where neither (or only an incomplete set of) inputs was provided, or values were empty strings.","triggerScenarios":"Running `slim merge` with no images at all, or with empty-string values (e.g., `--image ''` or a shell variable that expanded to nothing) so FirstImage/LastImage remain empty at merge/cli.go:96.","commonSituations":"Forgetting image arguments entirely; environment variables holding image names are unset (`--image $IMG1`); CI scripts with empty template variables; typos in flag names so values never get populated.","solutions":["Supply both image references explicitly: `slim merge image1 image2`.","Verify shell variables are set before interpolation (`echo $IMG1 $IMG2`).","Check the flag spelling; unknown/misspelled flags leave values empty.","In CI, add a guard step that fails early if image variables are empty."],"exampleFix":"// before\nslim merge --image $IMG1 --image $IMG2   # IMG2 unset -> --image ''\n// after\n: \"${IMG1:?unset}\"; : \"${IMG2:?unset}\"\nslim merge --image \"$IMG1\" --image \"$IMG2\"","handlingStrategy":"validation","validationCode":": \"${IMG1:?IMG1 unset}\"; : \"${IMG2:?IMG2 unset}\"\n[ -n \"$IMG1\" ] && [ -n \"$IMG2\" ] || { echo \"both images required\"; exit 2; }","typeGuard":null,"tryCatchPattern":"if err := runMerge(args); err != nil && strings.Contains(err.Error(), \"not enough image references\") {\n    // fail fast in CI with a clear message about missing image inputs\n}","preventionTips":["Guard env-var interpolation with ${VAR:?} in CI","Never pass --image '' — check variables before expansion","Verify flag spellings so values actually populate"],"tags":["cli","parameters","merge"],"backgroundTag":"missing-required-argument","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}