fixing help message printing

This commit is contained in:
Chris Lu
2012-09-03 20:40:38 -07:00
parent a56a523f29
commit 03aa23fb1b
5 changed files with 47 additions and 36 deletions

View File

@@ -38,7 +38,10 @@ func (c *Command) Name() string {
}
func (c *Command) Usage() {
fmt.Fprintf(os.Stderr, "Usage: %s\n", c.UsageLine)
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)
}