add version command
This commit is contained in:
parent
ae4aeeafc4
commit
0bb56e9716
8
main.go
8
main.go
|
@ -15,6 +15,8 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
const version = "0.0.2"
|
||||
|
||||
type commandFunc func(*scard.Card) error
|
||||
|
||||
var (
|
||||
|
@ -45,6 +47,7 @@ func initLogger() {
|
|||
|
||||
func init() {
|
||||
commands = map[string]commandFunc{
|
||||
"version": commandVersion,
|
||||
"install": commandInstall,
|
||||
"info": commandInfo,
|
||||
"delete": commandDelete,
|
||||
|
@ -204,6 +207,11 @@ func askInt(description string) int {
|
|||
return int(i)
|
||||
}
|
||||
|
||||
func commandVersion(card *scard.Card) error {
|
||||
fmt.Printf("version %+v\n", version)
|
||||
return nil
|
||||
}
|
||||
|
||||
func commandInstall(card *scard.Card) error {
|
||||
if *flagCapFile == "" {
|
||||
logger.Error("you must specify a cap file path with the -f flag\n")
|
||||
|
|
Loading…
Reference in New Issue