diff --git a/pkg/app/usage.go b/pkg/app/usage.go index e0f3f5bc9..1aae6362a 100644 --- a/pkg/app/usage.go +++ b/pkg/app/usage.go @@ -11,11 +11,12 @@ import ( "strings" "text/template" + "github.com/fastly/kingpin" + "github.com/fastly/cli/pkg/cmd" fsterr "github.com/fastly/cli/pkg/errors" "github.com/fastly/cli/pkg/global" "github.com/fastly/cli/pkg/text" - "github.com/fastly/kingpin" ) // Usage returns a contextual usage string for the application. In order to deal @@ -292,6 +293,13 @@ func processCommandInput( return command, cmdName, help(vars, err) } + if len(opts.Args) == 1 && opts.Args[0] == "--" { + return command, cmdName, fsterr.RemediationError{ + Inner: errors.New("-- is invalid input when not followed by a positional argument"), + Remediation: "If looking for help output try: `fastly help` for full command list or `fastly --help` for command summary.", + } + } + // NOTE: `fastly help`, no flags, or only globals, should skip conditional. // // This is because the `ctx` variable will be assigned a