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