From dc5694bdc4e8c96b9d01e240a01a38e48dabb21b Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 22 Feb 2021 15:05:55 +0800 Subject: [PATCH] improvement: specify 'vela exec' error hint --- pkg/commands/exec.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/commands/exec.go b/pkg/commands/exec.go index aba7cbed4..866024fdb 100644 --- a/pkg/commands/exec.go +++ b/pkg/commands/exec.go @@ -77,9 +77,13 @@ func NewExecCommand(c types.Args, ioStreams util.IOStreams) *cobra.Command { ioStreams.Error("Please specify an application name.") return nil } + if len(args) == 1 { + ioStreams.Error("Please specify at least one command for the container.") + return nil + } argsLenAtDash := cmd.ArgsLenAtDash() if argsLenAtDash != 1 { - ioStreams.Error("Please specify at least one command for the container.") + ioStreams.Error("vela exec APP_NAME COMMAND is not supported. Use vela exec APP_NAME -- COMMAND instead.") return nil }