github.com/arieschain/arieschain@v0.0.0-20191023063405-37c074544356/cmd/qctkey/main.go (about)

     1  
     2  package main
     3  
     4  import (
     5  	"fmt"
     6  	"os"
     7  	"github.com/quickchainproject/quickchain/cmd/utils"
     8  	"gopkg.in/urfave/cli.v1"
     9  )
    10  
    11  const (
    12  	defaultKeyfileName = "keyfile.json"
    13  )
    14  
    15  // Git SHA1 commit hash of the release (set via linker flags)
    16  var gitCommit = ""
    17  
    18  var app *cli.App
    19  
    20  func init() {
    21  	app = utils.NewApp(gitCommit, "an Ethereum key manager")
    22  	app.Commands = []cli.Command{
    23  		commandGenerate,
    24  		commandInspect,
    25  		commandSignMessage,
    26  		commandVerifyMessage,
    27  	}
    28  }
    29  
    30  //Commonly used command line flags.
    31  var (
    32  	passphraseFlag = cli.StringFlag{
    33  		Name:  "passwordfile",
    34  		Usage: "the file that contains the passphrase for the keyfile",
    35  	}
    36  	jsonFlag = cli.BoolFlag{
    37  		Name:  "json",
    38  		Usage: "output JSON instead of human-readable format",
    39  	}
    40  )
    41  
    42  func main() {
    43  	if err := app.Run(os.Args); err != nil {
    44  		fmt.Fprintln(os.Stderr, err)
    45  		os.Exit(1)
    46  	}
    47  }