seaweedfs/weed/command/shell.go

39 lines
808 B
Go
Raw Normal View History

package command
2012-08-24 03:56:09 +00:00
import (
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/server"
"github.com/chrislusf/seaweedfs/weed/shell"
"github.com/spf13/viper"
)
var (
shellOptions shell.ShellOptions
2012-08-24 03:56:09 +00:00
)
func init() {
2013-01-17 08:56:56 +00:00
cmdShell.Run = runShell // break init cycle
shellOptions.Masters = cmdShell.Flag.String("master", "localhost:9333", "comma-separated master servers")
2012-08-24 03:56:09 +00:00
}
var cmdShell = &Command{
2013-01-17 08:56:56 +00:00
UsageLine: "shell",
Short: "run interactive administrative commands",
Long: `run interactive administrative commands.
2012-08-24 03:56:09 +00:00
`,
}
2013-01-17 08:56:56 +00:00
var ()
2012-08-24 03:56:09 +00:00
func runShell(command *Command, args []string) bool {
weed_server.LoadConfiguration("security", false)
shellOptions.GrpcDialOption = security.LoadClientTLS(viper.Sub("grpc"), "client")
shell.RunShell(shellOptions)
return true
2012-08-24 03:56:09 +00:00
}