aboutsummaryrefslogtreecommitdiff
path: root/weed-fs/src/cmd/weed/command.go
diff options
context:
space:
mode:
authorchris.lu@gmail.com <chris.lu@gmail.com@282b0af5-e82d-9cf1-ede4-77906d7719d0>2012-08-07 01:20:26 +0000
committerchris.lu@gmail.com <chris.lu@gmail.com@282b0af5-e82d-9cf1-ede4-77906d7719d0>2012-08-07 01:20:26 +0000
commit3f1136c19475eeafb60c84456328fd01174b0817 (patch)
treeab23e2e022cfd4bdff3bbe785700435c3173953f /weed-fs/src/cmd/weed/command.go
parent51860424a6036cd9bda3422f10849d180bd1d36e (diff)
downloadseaweedfs-3f1136c19475eeafb60c84456328fd01174b0817.tar.xz
seaweedfs-3f1136c19475eeafb60c84456328fd01174b0817.zip
migrate fix command
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@63 282b0af5-e82d-9cf1-ede4-77906d7719d0
Diffstat (limited to 'weed-fs/src/cmd/weed/command.go')
-rw-r--r--weed-fs/src/cmd/weed/command.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/weed-fs/src/cmd/weed/command.go b/weed-fs/src/cmd/weed/command.go
index aa59459bd..77adcac66 100644
--- a/weed-fs/src/cmd/weed/command.go
+++ b/weed-fs/src/cmd/weed/command.go
@@ -10,7 +10,7 @@ import (
type Command struct {
// Run runs the command.
// The args are the arguments after the command name.
- Run func(cmd *Command, args []string)
+ 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.
@@ -25,9 +25,6 @@ type Command struct {
// Flag is a set of flags specific to this command.
Flag flag.FlagSet
- // CustomFlags indicates that the command will do its own
- // flag parsing.
- CustomFlags bool
}
// Name returns the command's name: the first word in the usage line.
@@ -41,8 +38,8 @@ func (c *Command) Name() string {
}
func (c *Command) Usage() {
- fmt.Fprintf(os.Stderr, "usage: %s\n\n", c.UsageLine)
- fmt.Fprintf(os.Stderr, "%s\n", strings.TrimSpace(c.Long))
+ fmt.Fprintf(os.Stderr, "Usage: %s\n", c.UsageLine)
+ fmt.Fprintf(os.Stderr, " %s\n", strings.TrimSpace(c.Long))
os.Exit(2)
}