Skip to content

Commit c959caf

Browse files
committed
-version flag
1 parent d0ff658 commit c959caf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/mev-boost/main.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"flag"
5+
"fmt"
56
"os"
67
"strconv"
78
"strings"
@@ -31,8 +32,9 @@ var (
3132
maxHeaderBytes = getEnvInt("MAX_HEADER_BYTES", 4000) // max header byte size for requests for dos prevention
3233

3334
// cli flags
34-
logJSON = flag.Bool("json", defaultLogJSON, "log in JSON format instead of text")
35-
logLevel = flag.String("loglevel", defaultLogLevel, "log-level: trace, debug, info, warn/warning, error, fatal, panic")
35+
printVersion = flag.Bool("version", false, "only print version")
36+
logJSON = flag.Bool("json", defaultLogJSON, "log in JSON format instead of text")
37+
logLevel = flag.String("loglevel", defaultLogLevel, "log-level: trace, debug, info, warn/warning, error, fatal, panic")
3638

3739
listenAddr = flag.String("addr", defaultListenAddr, "listen-address for mev-boost server")
3840
relayURLs = flag.String("relays", "", "relay urls - single entry or comma-separated list (scheme://pubkey@host)")
@@ -53,6 +55,10 @@ func main() {
5355
flag.Parse()
5456
logrus.SetOutput(os.Stdout)
5557

58+
if *printVersion {
59+
fmt.Printf("mev-boost %s\n", version)
60+
return
61+
}
5662
// Set the server version
5763
server.Version = version
5864

0 commit comments

Comments
 (0)