mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
report unknown commands
This commit is contained in:
parent
53e2e73de2
commit
067b935763
|
@ -70,13 +70,18 @@ func RunShell(options ShellOptions) {
|
||||||
} else if cmd == "exit" || cmd == "quit" {
|
} else if cmd == "exit" || cmd == "quit" {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
foundCommand := false
|
||||||
for _, c := range commands {
|
for _, c := range commands {
|
||||||
if c.Name() == cmd {
|
if c.Name() == cmd {
|
||||||
if err := c.Do(args, commandEnv, os.Stdout); err != nil {
|
if err := c.Do(args, commandEnv, os.Stdout); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||||
}
|
}
|
||||||
|
foundCommand = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !foundCommand {
|
||||||
|
fmt.Fprintf(os.Stderr, "unknown command: %v\n", cmd)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue