aboutsummaryrefslogtreecommitdiff
path: root/src/weed/shell.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-02-10 03:25:35 -0800
committerChris Lu <chris.lu@gmail.com>2013-02-10 03:25:35 -0800
commitab6fb13ad795763ba7fc7c91696d2890be6da543 (patch)
tree3d956452bdcef7ea4b50457faff07df06f8d4346 /src/weed/shell.go
parent1b6f53cdac9a44370f67276ede138f5cde8806c2 (diff)
downloadseaweedfs-ab6fb13ad795763ba7fc7c91696d2890be6da543.tar.xz
seaweedfs-ab6fb13ad795763ba7fc7c91696d2890be6da543.zip
avoid the "src" folder
Diffstat (limited to 'src/weed/shell.go')
-rw-r--r--src/weed/shell.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/weed/shell.go b/src/weed/shell.go
deleted file mode 100644
index daf0b7e1f..000000000
--- a/src/weed/shell.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package main
-
-import (
- "bufio"
- "fmt"
- "os"
-)
-
-func init() {
- cmdShell.Run = runShell // break init cycle
-}
-
-var cmdShell = &Command{
- UsageLine: "shell",
- Short: "run interactive commands, now just echo",
- Long: `run interactive commands.
-
- `,
-}
-
-var ()
-
-func runShell(command *Command, args []string) bool {
- r := bufio.NewReader(os.Stdin)
- o := bufio.NewWriter(os.Stdout)
- e := bufio.NewWriter(os.Stderr)
- prompt := func() {
- o.WriteString("> ")
- o.Flush()
- }
- readLine := func() string {
- ret, err := r.ReadString('\n')
- if err != nil {
- fmt.Fprint(e, err)
- os.Exit(1)
- }
- return ret
- }
- execCmd := func(cmd string) int {
- if cmd != "" {
- o.WriteString(cmd)
- }
- return 0
- }
-
- cmd := ""
- for {
- prompt()
- cmd = readLine()
- execCmd(cmd)
- }
- return true
-}