Skip to content

Commit

Permalink
[Feature][kubectl-plugin] return usage error when no entrypoint input
Browse files Browse the repository at this point in the history
  • Loading branch information
chiayi committed Nov 6, 2024
1 parent b875b85 commit 90c56cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kubectl-plugin/pkg/cmd/job/job_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ func NewJobSubmitCommand(streams genericclioptions.IOStreams) *cobra.Command {
Example: jobSubmitExample,
RunE: func(cmd *cobra.Command, args []string) error {
entryPointStart := cmd.ArgsLenAtDash()
if entryPointStart == -1 || len(args[entryPointStart:]) == 0 {
return cmdutil.UsageErrorf(cmd, "%s", cmd.Use)
}
options.entryPoint = strings.Join(args[entryPointStart:], " ")
if err := options.Complete(); err != nil {
return err
Expand Down

0 comments on commit 90c56cb

Please sign in to comment.