mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-23 22:34: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 .
|
||||
|
||||
release: tag release-deps dockerhub
|
||||
gox -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" .
|
||||
gox -ldflags "-X main.version=${VERSION}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" .
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
|
|
6
main.go
6
main.go
|
@ -25,6 +25,7 @@ var apiconf *cfgapi.Config
|
|||
var uiconf *cfgui.Config
|
||||
var comconf *cfgcom.Config
|
||||
var exitCh chan int
|
||||
var version string
|
||||
|
||||
func configure() {
|
||||
cfgcom.RegisterFlags()
|
||||
|
@ -40,6 +41,11 @@ func configure() {
|
|||
}
|
||||
|
||||
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" {
|
||||
args := os.Args
|
||||
os.Args = []string{args[0]}
|
||||
|
|
Loading…
Reference in a new issue