diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-18 09:25:47 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-18 09:25:47 -0700 |
commit | cdf813f07b207c14bb9fa03f38d734b45e40823e (patch) | |
tree | 109c6cefb3580b9ed9b314ce40bd130728d587ff /mattermost.go | |
parent | 1aa4913c44ba9a342d240e5e1ca9d5e89929e499 (diff) | |
parent | 5a436fd447753124b3f7705ecb123ecf5762bc24 (diff) | |
download | chat-cdf813f07b207c14bb9fa03f38d734b45e40823e.tar.gz chat-cdf813f07b207c14bb9fa03f38d734b45e40823e.tar.bz2 chat-cdf813f07b207c14bb9fa03f38d734b45e40823e.zip |
merging
Diffstat (limited to 'mattermost.go')
-rw-r--r-- | mattermost.go | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mattermost.go b/mattermost.go index 0bdb90424..f54bcf15f 100644 --- a/mattermost.go +++ b/mattermost.go @@ -23,6 +23,7 @@ import ( var flagCmdCreateTeam bool var flagCmdCreateUser bool var flagCmdAssignRole bool +var flagCmdVersion bool var flagCmdResetPassword bool var flagConfigFile string var flagEmail string @@ -42,6 +43,7 @@ func main() { } pwd, _ := os.Getwd() + l4g.Info("Current version is %v (%v/%v/%v)", model.CurrentVersion, model.BuildNumber, model.BuildDate, model.BuildHash) l4g.Info("Current working directory is %v", pwd) l4g.Info("Loaded config file from %v", utils.FindConfigFile(flagConfigFile)) @@ -83,14 +85,16 @@ func parseCmds() { flag.BoolVar(&flagCmdCreateTeam, "create_team", false, "") flag.BoolVar(&flagCmdCreateUser, "create_user", false, "") flag.BoolVar(&flagCmdAssignRole, "assign_role", false, "") + flag.BoolVar(&flagCmdVersion, "version", false, "") flag.BoolVar(&flagCmdResetPassword, "reset_password", false, "") flag.Parse() - flagRunCmds = flagCmdCreateTeam || flagCmdCreateUser || flagCmdAssignRole || flagCmdResetPassword + flagRunCmds = flagCmdCreateTeam || flagCmdCreateUser || flagCmdAssignRole || flagCmdResetPassword || flagCmdVersion } func runCmds() { + cmdVersion() cmdCreateTeam() cmdCreateUser() cmdAssignRole() @@ -184,6 +188,17 @@ func cmdCreateUser() { } } +func cmdVersion() { + if flagCmdVersion { + fmt.Fprintln(os.Stderr, "Version: "+model.CurrentVersion) + fmt.Fprintln(os.Stderr, "Build Number: "+model.BuildNumber) + fmt.Fprintln(os.Stderr, "Build Date: "+model.BuildDate) + fmt.Fprintln(os.Stderr, "Build Hash: "+model.BuildHash) + + os.Exit(0) + } +} + func cmdAssignRole() { if flagCmdAssignRole { if len(flagTeamName) == 0 { @@ -298,6 +313,8 @@ Usage: platform [options] + -version Display the current version + -config="config.json" Path to the config file -email="user@example.com" Email address used in other commands |