aboutsummaryrefslogtreecommitdiff
path: root/src/command.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-02-10 03:53:52 -0800
committerChris Lu <chris.lu@gmail.com>2013-02-10 03:53:52 -0800
commit37a1a70cc3c960eb288257646d4888eb75473fc6 (patch)
tree0c4bc8a286597cd79e22b1ce02cd9cd3b1c44602 /src/command.go
parent7743ddd7db7e1d448964b4dc9561650282519650 (diff)
downloadseaweedfs-37a1a70cc3c960eb288257646d4888eb75473fc6.tar.xz
seaweedfs-37a1a70cc3c960eb288257646d4888eb75473fc6.zip
remove unused files
Diffstat (limited to 'src/command.go')
-rw-r--r--src/command.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/command.go b/src/command.go
deleted file mode 100644
index c8d86ca66..000000000
--- a/src/command.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package main
-
-import (
- "flag"
- "fmt"
- "os"
- "strings"
-)
-
-type Command struct {
- // Run runs the command.
- // The args are the arguments after the command name.
- Run func(cmd *Command, args []string) bool
-
- // UsageLine is the one-line usage message.
- // The first word in the line is taken to be the command name.
- UsageLine string
-
- // Short is the short description shown in the 'go help' output.
- Short string
-
- // Long is the long message shown in the 'go help <this-command>' output.
- Long string
-
- // Flag is a set of flags specific to this command.
- Flag flag.FlagSet
-
- IsDebug *bool
-}
-
-// Name returns the command's name: the first word in the usage line.
-func (c *Command) Name() string {
- name := c.UsageLine
- i := strings.Index(name, " ")
- if i >= 0 {
- name = name[:i]
- }
- return name
-}
-
-func (c *Command) Usage() {
- fmt.Fprintf(os.Stderr, "Example: weed %s\n", c.UsageLine)
- fmt.Fprintf(os.Stderr, "Default Usage:\n")
- c.Flag.PrintDefaults()
- fmt.Fprintf(os.Stderr, "Description:\n")
- fmt.Fprintf(os.Stderr, " %s\n", strings.TrimSpace(c.Long))
- os.Exit(2)
-}
-
-// Runnable reports whether the command can be run; otherwise
-// it is a documentation pseudo-command such as importpath.
-func (c *Command) Runnable() bool {
- return c.Run != nil
-}