Added /version command that outputs commit the server was built on.

This commit is contained in:
empathetic-alligator committed 2014-12-17 20:22:51 -05:00
1 parent 59ed9a6bae
commit bdb66b09e7
3 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ all: $(BINARY)
go build ./...
$(BINARY): **/*.go *.go
go build .
go build -ldflags "-X main.buildCommit `git rev-parse --short HEAD`" .
deps:
go get .
+2
View File
@@ -431,6 +431,8 @@ func (c *Client) handleShell(channel ssh.Channel) {
}
}()
}
case "/version":
c.SysMsg("Version " + buildCommit)
default:
c.SysMsg("Invalid command: %s", line)
+1
View File
@@ -33,6 +33,7 @@ var logLevels = []log.Level{
log.Debug,
}
var buildCommit string
func main() {
options := Options{}
parser := flags.NewParser(&options, flags.Default)