summaryrefslogtreecommitdiff
path: root/cmd/tunneld
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/tunneld')
-rw-r--r--cmd/tunneld/Makefile1
-rw-r--r--cmd/tunneld/main.go21
2 files changed, 15 insertions, 7 deletions
diff --git a/cmd/tunneld/Makefile b/cmd/tunneld/Makefile
deleted file mode 100644
index 946951c..0000000
--- a/cmd/tunneld/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../scripts/build.mk
diff --git a/cmd/tunneld/main.go b/cmd/tunneld/main.go
index c808aab..40d60d8 100644
--- a/cmd/tunneld/main.go
+++ b/cmd/tunneld/main.go
@@ -22,13 +22,16 @@ import (
)
var (
- debugFlag = flag.Bool("d", false, "debug: print time and source info")
- forceFlag = flag.Bool("f", false, "try start with force")
- syslogFlag = flag.Bool("s", false, "write log to syslog instead of stdout")
- configFlag = flag.String("c", "", "path to configuration file")
- socketFlag = flag.String("S", "", "path to control socket")
+ debugFlag = flag.Bool("d", false, "debug: print time and source info")
+ forceFlag = flag.Bool("f", false, "try start with force")
+ syslogFlag = flag.Bool("s", false, "write log to syslog instead of stdout")
+ configFlag = flag.String("c", "", "path to configuration file")
+ socketFlag = flag.String("S", "", "path to control socket")
+ versionFlag = flag.Bool("version", false, "print version and exit")
)
+var BuildVersion string
+
const trimSize = 32
func initLog() {
@@ -312,6 +315,12 @@ func deconfigure(s *server.Server) error {
func main() {
flag.Parse()
+
+ if *versionFlag {
+ fmt.Fprintln(os.Stderr, BuildVersion)
+ os.Exit(1)
+ }
+
initLog()
socket := getSocketPath()
@@ -323,7 +332,7 @@ func main() {
}
}
- s, err := server.New(socket)
+ s, err := server.New(socket, BuildVersion)
if err != nil {
log.Fatal(err)
}