Fixed a basic UI regression due to a recent godep update

In one of the latest docker UI updates, the flags structure expects to
have a ShortUsage function. Without that any UI event that triggers an
short usage panics.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2015-06-15 19:56:56 -07:00
parent e228afce04
commit c0bcb8dff3
1 changed files with 4 additions and 1 deletions

View File

@ -83,6 +83,10 @@ func (cli *NetworkCli) Subcmd(chain, name, signature, description string, exitOn
}
flags := flag.NewFlagSet(name, errorHandling)
flags.Usage = func() {
flags.ShortUsage()
flags.PrintDefaults()
}
flags.ShortUsage = func() {
options := ""
if signature != "" {
signature = " " + signature
@ -92,7 +96,6 @@ func (cli *NetworkCli) Subcmd(chain, name, signature, description string, exitOn
}
fmt.Fprintf(cli.out, "\nUsage: %s %s%s%s\n\n%s\n\n", chain, name, options, signature, description)
flags.SetOutput(cli.out)
flags.PrintDefaults()
}
return flags
}