From 067b9357630e79cdaa5117243f9a8adc21dc11a1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 23 Apr 2019 22:29:36 -0700 Subject: [PATCH] report unknown commands --- weed/shell/shell_liner.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go index 2fc64b60f..2c3058cbf 100644 --- a/weed/shell/shell_liner.go +++ b/weed/shell/shell_liner.go @@ -70,13 +70,18 @@ func RunShell(options ShellOptions) { } else if cmd == "exit" || cmd == "quit" { return } else { + foundCommand := false for _, c := range commands { if c.Name() == cmd { if err := c.Do(args, commandEnv, os.Stdout); err != nil { fmt.Fprintf(os.Stderr, "error: %v\n", err) } + foundCommand = true } } + if !foundCommand { + fmt.Fprintf(os.Stderr, "unknown command: %v\n", cmd) + } } }