mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
![Chris Lu](/assets/img/avatar_default.png)
fix https://github.com/chrislusf/seaweedfs/issues/889 echo "fs.du http://localhost:8888/some/path" | weed shell
29 lines
451 B
Go
29 lines
451 B
Go
package shell
|
|
|
|
import (
|
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
|
"google.golang.org/grpc"
|
|
"io"
|
|
)
|
|
|
|
type ShellOptions struct {
|
|
Masters *string
|
|
GrpcDialOption grpc.DialOption
|
|
}
|
|
|
|
type commandEnv struct {
|
|
env map[string]string
|
|
masterClient *wdclient.MasterClient
|
|
option ShellOptions
|
|
}
|
|
|
|
type command interface {
|
|
Name() string
|
|
Help() string
|
|
Do([]string, *commandEnv, io.Writer) error
|
|
}
|
|
|
|
var (
|
|
commands = []command{}
|
|
)
|