Add version information

This commit is contained in:
Aaron Lindsay 2013-09-04 21:29:53 -04:00
parent d883e3d92d
commit 393eb31c3c
4 changed files with 25 additions and 0 deletions

2
api.go
View File

@ -1,5 +1,7 @@
package asink package asink
const API_VERSION_STRING = "0.1"
type APIStatus uint32 type APIStatus uint32
const ( const (

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"asink"
"fmt" "fmt"
"os" "os"
) )
@ -22,6 +23,11 @@ var commands []Command = []Command{
fn: StopClient, fn: StopClient,
explanation: "Stop the client daemon", explanation: "Stop the client daemon",
}, },
Command{
cmd: "version",
fn: PrintVersion,
explanation: "Display the current version",
},
/* Command{ /* Command{
cmd: "status", cmd: "status",
fn: GetStatus, fn: GetStatus,
@ -47,3 +53,7 @@ func main() {
fmt.Printf("\t%s\t\t%s\n", c.cmd, c.explanation) fmt.Printf("\t%s\t\t%s\n", c.cmd, c.explanation)
} }
} }
func PrintVersion(args []string) {
fmt.Println("Asink client version " + asink.VERSION_STRING + ", using version " + asink.API_VERSION_STRING + " of the Asink API.")
}

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"asink"
"fmt" "fmt"
"os" "os"
) )
@ -37,6 +38,11 @@ var commands []Command = []Command{
fn: UserMod, fn: UserMod,
explanation: "Modify a user", explanation: "Modify a user",
}, },
Command{
cmd: "version",
fn: PrintVersion,
explanation: "Display the current version",
},
} }
func main() { func main() {
@ -56,3 +62,7 @@ func main() {
fmt.Printf("\t%s\t\t%s\n", c.cmd, c.explanation) fmt.Printf("\t%s\t\t%s\n", c.cmd, c.explanation)
} }
} }
func PrintVersion(args []string) {
fmt.Println("Asink server version " + asink.VERSION_STRING + ", using version " + asink.API_VERSION_STRING + " of the Asink API.")
}

3
version.go Normal file
View File

@ -0,0 +1,3 @@
package asink
const VERSION_STRING = "0.1"