diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-16 17:37:11 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-16 17:37:11 -0700 |
commit | cef7a1aae4205ebf4fbd8958f1f870ff69759edf (patch) | |
tree | a3bbd45979a89f9a4030f750b1a30099d7e565b9 /mattermost.go | |
parent | e644b53b72d346539f5c58cc0cb0a07c4054cbcb (diff) | |
download | chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.tar.gz chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.tar.bz2 chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.zip |
PLT-92 Adding server side versioning to the binary
Diffstat (limited to 'mattermost.go')
-rw-r--r-- | mattermost.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mattermost.go b/mattermost.go index 0bdb90424..75e405e88 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 @@ -83,14 +84,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 +187,16 @@ func cmdCreateUser() { } } +func cmdVersion() { + if flagCmdVersion { + fmt.Fprintln(os.Stderr, "Version: "+model.GetFullVersion()) + fmt.Fprintln(os.Stderr, "Build Number: "+model.BUILD_NUMBER) + fmt.Fprintln(os.Stderr, "Build Date: "+model.BUILD_DATE) + + os.Exit(0) + } +} + func cmdAssignRole() { if flagCmdAssignRole { if len(flagTeamName) == 0 { @@ -298,6 +311,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 |