mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-27 16:24:04 +00:00
Merge pull request #122 from swordbeta/version-number-flag
Add version flag which displays the current version.
This commit is contained in:
commit
899774fe8f
2 changed files with 7 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ combined:
|
||||||
go install .
|
go install .
|
||||||
|
|
||||||
release: tag release-deps dockerhub
|
release: tag release-deps dockerhub
|
||||||
gox -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" .
|
gox -ldflags "-X main.version=${VERSION}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" .
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
6
main.go
6
main.go
|
@ -25,6 +25,7 @@ var apiconf *cfgapi.Config
|
||||||
var uiconf *cfgui.Config
|
var uiconf *cfgui.Config
|
||||||
var comconf *cfgcom.Config
|
var comconf *cfgcom.Config
|
||||||
var exitCh chan int
|
var exitCh chan int
|
||||||
|
var version string
|
||||||
|
|
||||||
func configure() {
|
func configure() {
|
||||||
cfgcom.RegisterFlags()
|
cfgcom.RegisterFlags()
|
||||||
|
@ -40,6 +41,11 @@ func configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if len(os.Args) > 1 && (os.Args[1] == "-version" || os.Args[1] == "--version") {
|
||||||
|
fmt.Println("MailHog version: " + version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
if len(os.Args) > 1 && os.Args[1] == "sendmail" {
|
if len(os.Args) > 1 && os.Args[1] == "sendmail" {
|
||||||
args := os.Args
|
args := os.Args
|
||||||
os.Args = []string{args[0]}
|
os.Args = []string{args[0]}
|
||||||
|
|
Loading…
Reference in a new issue