fix usage func
This commit is contained in:
parent
4b99feff82
commit
9e30d84ebf
|
@ -1,3 +1,3 @@
|
|||
wallet.cap
|
||||
/build
|
||||
*.cap
|
||||
/applets
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
.PHONY: build
|
||||
|
||||
GOBIN = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))build/bin
|
||||
BIN_NAME="status-hardware-wallet"
|
||||
|
||||
build:
|
||||
go build -i -o $(GOBIN)/$(BIN_NAME) -v ./cmd/status-hardware-wallet
|
||||
@echo "Compilation done."
|
||||
@echo "Run \"build/bin/$(BIN_NAME) -h\" to view available commands."
|
|
@ -24,7 +24,7 @@ var (
|
|||
|
||||
flagCapFile = flag.String("a", "", "applet cap file path")
|
||||
flagOverwrite = flag.Bool("f", false, "force applet installation if already installed")
|
||||
flagLogLevel = flag.String("l", "", `Log level, one of: "ERROR", "WARN", "INFO", "DEBUG", and "TRACE"`)
|
||||
flagLogLevel = flag.String("l", "", `Log level, one of: "error", "warn", "info", "debug", and "trace"`)
|
||||
)
|
||||
|
||||
func initLogger() {
|
||||
|
@ -43,6 +43,15 @@ func initLogger() {
|
|||
}
|
||||
|
||||
func init() {
|
||||
commands = map[string]commandFunc{
|
||||
"install": commandInstall,
|
||||
"info": commandInfo,
|
||||
"delete": commandDelete,
|
||||
"init": commandInit,
|
||||
"pair": commandPair,
|
||||
"status": commandStatus,
|
||||
}
|
||||
|
||||
if len(os.Args) < 2 {
|
||||
usage()
|
||||
}
|
||||
|
@ -53,15 +62,6 @@ func init() {
|
|||
}
|
||||
|
||||
initLogger()
|
||||
|
||||
commands = map[string]commandFunc{
|
||||
"install": commandInstall,
|
||||
"info": commandInfo,
|
||||
"delete": commandDelete,
|
||||
"init": commandInit,
|
||||
"pair": commandPair,
|
||||
"status": commandStatus,
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
|
|
Loading…
Reference in New Issue