{"record":{"id":"1fe5254ff83240ed","repo":"slimtoolkit/slim","slug":"no-target-selected","errorCode":null,"errorMessage":"no target selected","messagePattern":"no target selected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/command/registry/cli.go","lineNumber":246,"sourceCode":"\t\t\t\tcflag(FlagOCI),\n\t\t\t},\n\t\t\tAction: func(ctx *cli.Context) error {\n\t\t\t\tgcvalues := command.GlobalFlagValues(ctx)\n\t\t\t\txc := app.NewExecutionContext(\n\t\t\t\t\tfullCmdName(PushCmdName),\n\t\t\t\t\tgcvalues.QuietCLIMode,\n\t\t\t\t\tgcvalues.OutputFormat)\n\n\t\t\t\tcparams, err := PushCommandFlagValues(ctx)\n\t\t\t\tif err != nil {\n\t\t\t\t\txc.Out.Error(\"params\", err.Error())\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tif cparams.TargetType == \"\" {\n\t\t\t\t\tif ctx.Args().Len() < 1 {\n\t\t\t\t\t\txc.Out.Error(\"params.target\", \"missing pull target\")\n\t\t\t\t\t\treturn fmt.Errorf(\"no target selected\")\n\t\t\t\t\t}\n\n\t\t\t\t\tcparams.TargetRef = ctx.Args().First()\n\t\t\t\t\tcparams.TargetType = ttDocker\n\t\t\t\t}\n\n\t\t\t\tOnPushCommand(xc, gcvalues, cparams)\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName:  CopyCmdName,\n\t\t\tUsage: CopyCmdNameUsage,\n\t\t\tAction: func(ctx *cli.Context) error {\n\t\t\t\tgcvalues := command.GlobalFlagValues(ctx)\n\t\t\t\txc := app.NewExecutionContext(\n\t\t\t\t\tfullCmdName(CopyCmdName),\n\t\t\t\t\tgcvalues.QuietCLIMode,","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/command/registry/cli.go#L228-L264","documentation":"This error is thrown by the CLI pull command handler when no target image reference was supplied. The code checks cparams.TargetType and, if empty, requires at least one positional CLI argument; with zero args there is nothing to pull, so it prints 'missing pull target' and returns this error to abort the command.","triggerScenarios":"Running the registry pull command without a target argument (ctx.Args().Len() < 1) and without target type/ref already set in cparams, e.g. 'docker run ... registry pull' with no image name.","commonSituations":"Users forget the image argument in scripts or CI pipelines; shell variables holding the image name expand to empty; incorrect subcommand usage where the image is expected as a flag but was never passed.","solutions":["Pass the image reference as the first positional argument, e.g. 'registry pull nginx:latest'","Set target parameters explicitly in the params/config if invoking programmatically","Check the command usage/help (xc.Out.Error prints 'missing pull target') to confirm expected arguments","Quote or default shell variables so an empty expansion doesn't drop the argument"],"exampleFix":"// before\nregistry pull\n// after\nregistry pull nginx:latest","handlingStrategy":"validation","validationCode":"if len(args) == 0 {\n    return fmt.Errorf(\"usage: registry pull <image-ref>\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the image reference as the first positional argument","Validate CLI arguments in wrapper scripts before invoking the command","Use shell parameter expansion with defaults: IMAGE_REF=${IMAGE_REF:?image ref required}"],"tags":["cli","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}