commands: add shorter helper vars to keep fmt sane

This commit is contained in:
Frank Schroeder 2017-10-18 02:38:48 +02:00
parent 983e4aa0eb
commit 9dec64dd17
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
1 changed files with 7 additions and 9 deletions

View File

@ -53,18 +53,16 @@ import (
var Commands map[string]cli.CommandFactory
func init() {
rev := consulversion.GitCommit
ver := consulversion.Version
verPre := consulversion.VersionPrerelease
verHuman := consulversion.GetHumanVersion()
ui := &cli.BasicUi{Writer: os.Stdout, ErrorWriter: os.Stderr}
Commands = map[string]cli.CommandFactory{
"agent": func() (cli.Command, error) {
return agent.New(
ui,
consulversion.GitCommit,
consulversion.Version,
consulversion.VersionPrerelease,
consulversion.GetHumanVersion(),
make(chan struct{}),
), nil
return agent.New(ui, rev, ver, verPre, verHuman, make(chan struct{})), nil
},
"catalog": func() (cli.Command, error) { return catalog.New(), nil },
@ -103,7 +101,7 @@ func init() {
"snapshot restore": func() (cli.Command, error) { return snaprestore.New(ui), nil },
"snapshot save": func() (cli.Command, error) { return snapsave.New(ui), nil },
"validate": func() (cli.Command, error) { return validate.New(ui), nil },
"version": func() (cli.Command, error) { return version.New(ui, consulversion.GetHumanVersion()), nil },
"version": func() (cli.Command, error) { return version.New(ui, verHuman), nil },
"watch": func() (cli.Command, error) { return watch.New(ui, makeShutdownCh()), nil },
}
}