diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-04-23 22:29:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-04-23 22:29:36 -0700 |
| commit | 067b9357630e79cdaa5117243f9a8adc21dc11a1 (patch) | |
| tree | 9152c482f6173d0bb8afdcfbeff89f0aa2b4bccb /weed | |
| parent | 53e2e73de2ed2d7145a7e60ca822d5ccdc3c10b9 (diff) | |
| download | seaweedfs-067b9357630e79cdaa5117243f9a8adc21dc11a1.tar.xz seaweedfs-067b9357630e79cdaa5117243f9a8adc21dc11a1.zip | |
report unknown commands
Diffstat (limited to 'weed')
| -rw-r--r-- | weed/shell/shell_liner.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) + } } } |
