aboutsummaryrefslogtreecommitdiff
path: root/weed/command/shell.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/shell.go')
-rw-r--r--weed/command/shell.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/weed/command/shell.go b/weed/command/shell.go
index 79f8b8bf9..34b5aef31 100644
--- a/weed/command/shell.go
+++ b/weed/command/shell.go
@@ -1,6 +1,8 @@
package command
import (
+ "fmt"
+
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/shell"
"github.com/chrislusf/seaweedfs/weed/util"
@@ -8,12 +10,14 @@ import (
)
var (
- shellOptions shell.ShellOptions
+ shellOptions shell.ShellOptions
+ shellInitialFilerUrl *string
)
func init() {
cmdShell.Run = runShell // break init cycle
shellOptions.Masters = cmdShell.Flag.String("master", "localhost:9333", "comma-separated master servers")
+ shellInitialFilerUrl = cmdShell.Flag.String("filer.url", "http://localhost:8888/", "initial filer url")
}
var cmdShell = &Command{
@@ -24,16 +28,17 @@ var cmdShell = &Command{
`,
}
-var ()
-
func runShell(command *Command, args []string) bool {
util.LoadConfiguration("security", false)
shellOptions.GrpcDialOption = security.LoadClientTLS(viper.Sub("grpc"), "client")
- shellOptions.FilerHost = "localhost"
- shellOptions.FilerPort = 8888
- shellOptions.Directory = "/"
+ var filerPwdErr error
+ shellOptions.FilerHost, shellOptions.FilerPort, shellOptions.Directory, filerPwdErr = util.ParseFilerUrl(*shellInitialFilerUrl)
+ if filerPwdErr != nil {
+ fmt.Printf("failed to parse url filer.url=%s : %v\n", *shellInitialFilerUrl, filerPwdErr)
+ return false
+ }
shell.RunShell(shellOptions)