summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
authorJack <jackdeng@gmail.com>2015-09-22 08:16:51 -0700
committerJack <jackdeng@gmail.com>2015-09-22 08:16:51 -0700
commit602bed85f2b32733f73e2edddb542fa36baac462 (patch)
tree06a6ee9b609a9122bc2f0e6f6e6300f9ba79a3aa /mattermost.go
parenta31868336f97a91bfd5a7e91e99a9b294d131f90 (diff)
parentf439c82d7c885b4c530ba9da0a41b17910743b55 (diff)
downloadchat-602bed85f2b32733f73e2edddb542fa36baac462.tar.gz
chat-602bed85f2b32733f73e2edddb542fa36baac462.tar.bz2
chat-602bed85f2b32733f73e2edddb542fa36baac462.zip
fix conflict
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go19
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