Add version information
This commit is contained in:
parent
d883e3d92d
commit
393eb31c3c
2
api.go
2
api.go
@ -1,5 +1,7 @@
|
|||||||
package asink
|
package asink
|
||||||
|
|
||||||
|
const API_VERSION_STRING = "0.1"
|
||||||
|
|
||||||
type APIStatus uint32
|
type APIStatus uint32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -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.")
|
||||||
|
}
|
||||||
|
@ -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
3
version.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package asink
|
||||||
|
|
||||||
|
const VERSION_STRING = "0.1"
|
Loading…
Reference in New Issue
Block a user