github.com/cheng762/platon-go@v1.8.17-0.20190529111256-7deff2d7be26/cmd/ctool/main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/PlatONnetwork/PlatON-Go/cmd/ctool/core"
     6  	"github.com/PlatONnetwork/PlatON-Go/cmd/utils"
     7  	"gopkg.in/urfave/cli.v1"
     8  	"os"
     9  	"sort"
    10  )
    11  
    12  var (
    13  	app = utils.NewApp("", "the wasm command line interface")
    14  )
    15  
    16  func init() {
    17  
    18  	// Initialize the CLI app
    19  	app.Commands = []cli.Command{
    20  		core.DeployCmd,
    21  		core.InvokeCmd,
    22  		core.SendTransactionCmd,
    23  		core.SendRawTransactionCmd,
    24  		core.GetTxReceiptCmd,
    25  		core.StabilityCmd,
    26  		core.StabPrepareCmd,
    27  	}
    28  	sort.Sort(cli.CommandsByName(app.Commands))
    29  	app.After = func(ctx *cli.Context) error {
    30  		return nil
    31  	}
    32  }
    33  
    34  func main() {
    35  	if err := app.Run(os.Args); err != nil {
    36  		fmt.Fprintln(os.Stderr, err)
    37  		os.Exit(1)
    38  	}
    39  }