github.com/iotexproject/iotex-core@v1.14.1-rc1/tools/actioninjector.v2/internal/cmd/root.go (about) 1 // Copyright (c) 2019 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package cmd 7 8 import ( 9 "github.com/spf13/cobra" 10 "go.uber.org/zap" 11 12 "github.com/iotexproject/iotex-core/pkg/log" 13 ) 14 15 // rootCmd represents the base command when called without any subcommands 16 var rootCmd = &cobra.Command{ 17 Use: "injector [command] [flags]", 18 Short: "Command-line interface for injecting actions", 19 Long: "injector is a command-line interface to generate address.", 20 } 21 22 // Execute adds all child commands to the root command and sets flags appropriately. 23 func Execute() { 24 if err := rootCmd.Execute(); err != nil { 25 log.L().Fatal("failed to add cmd", zap.Error(err)) 26 } 27 }