Skip to content

Commit e3ba45e

Browse files
committed
Fix output for "-version" to not contain unneccessary noise
1 parent 44560c9 commit e3ba45e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55
"fmt"
66
"net"
7+
"os"
78
"regexp"
89
"strings"
910
"time"
@@ -188,6 +189,11 @@ func ConfigLoad() {
188189
// Set up logging as soon as possible
189190
setupLogger()
190191

192+
if *versionInfo {
193+
fmt.Printf("smtprelay/%s (%s)\n", appVersion, buildTime)
194+
os.Exit(0)
195+
}
196+
191197
if *remotesStr == "" && *command == "" {
192198
log.Warn("no remotes or command set; mail will not be forwarded!")
193199
}

main.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"bytes"
55
"crypto/tls"
6-
"fmt"
76
"net"
87
"net/textproto"
98
"os"
@@ -282,11 +281,6 @@ func getTLSConfig() *tls.Config {
282281
func main() {
283282
ConfigLoad()
284283

285-
if *versionInfo {
286-
fmt.Printf("smtprelay/%s (%s)\n", appVersion, buildTime)
287-
os.Exit(0)
288-
}
289-
290284
log.WithField("version", appVersion).
291285
Debug("starting smtprelay")
292286

0 commit comments

Comments
 (0)