Collapsed nested commands in gaiacli
This commit is contained in:
parent
b10afcaf4c
commit
c7f31bdf26
2
Makefile
2
Makefile
|
@ -13,7 +13,7 @@ ci: get_tools get_vendor_deps build test_cover
|
|||
|
||||
# This can be unified later, here for easy demos
|
||||
gaia:
|
||||
go build $(BUILD_FLAGS) -o build/gaid ./examples/gaiad
|
||||
go build $(BUILD_FLAGS) -o build/gaiad ./examples/gaiad
|
||||
go build $(BUILD_FLAGS) -o build/gaiacli ./examples/gaiacli
|
||||
|
||||
build:
|
||||
|
|
|
@ -53,14 +53,10 @@ func init() {
|
|||
postCmd.PersistentFlags().String(flagPassword, "", "Password to use the named private key")
|
||||
}
|
||||
|
||||
// ClientCommands returns a sub-tree of all basic client commands
|
||||
// AddClientCommands returns a sub-tree of all basic client commands
|
||||
//
|
||||
// Call AddGetCommand and AddPostCommand to add custom txs and queries
|
||||
func ClientCommands() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "client",
|
||||
Short: "Interact with the chain via a light-client",
|
||||
}
|
||||
func AddClientCommands(cmd *cobra.Command) {
|
||||
cmd.AddCommand(
|
||||
initClientCommand(),
|
||||
statusCmd,
|
||||
|
@ -75,7 +71,6 @@ func ClientCommands() *cobra.Command {
|
|||
lineBreak,
|
||||
serveCommand(),
|
||||
)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// AddGetCommand adds one or more query subcommands
|
||||
|
|
|
@ -15,11 +15,11 @@ const (
|
|||
flagFee = "fee"
|
||||
)
|
||||
|
||||
// chubCmd is the entry point for this binary
|
||||
// gaiacliCmd is the entry point for this binary
|
||||
var (
|
||||
chubCmd = &cobra.Command{
|
||||
Use: "chub",
|
||||
Short: "Cosmos Hub command-line tool",
|
||||
gaiacliCmd = &cobra.Command{
|
||||
Use: "gaiacli",
|
||||
Short: "Gaia light-client",
|
||||
}
|
||||
|
||||
lineBreak = &cobra.Command{Run: func(*cobra.Command, []string) {}}
|
||||
|
@ -55,16 +55,15 @@ func main() {
|
|||
AddGetCommand(getAccountCmd)
|
||||
AddPostCommand(postSendCommand())
|
||||
|
||||
chubCmd.AddCommand(
|
||||
AddClientCommands(gaiacliCmd)
|
||||
gaiacliCmd.AddCommand(
|
||||
KeyCommands(),
|
||||
ClientCommands(),
|
||||
|
||||
lineBreak,
|
||||
VersionCmd,
|
||||
)
|
||||
|
||||
// prepare and add flags
|
||||
// executor := cli.PrepareMainCmd(chubCmd, "CH", os.ExpandEnv("$HOME/.cosmos-chub"))
|
||||
executor := cli.PrepareBaseCmd(chubCmd, "CH", os.ExpandEnv("$HOME/.cosmos-chub"))
|
||||
executor := cli.PrepareBaseCmd(gaiacliCmd, "GA", os.ExpandEnv("$HOME/.cosmos-chub"))
|
||||
executor.Execute()
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import:
|
|||
subpackages:
|
||||
- ripemd160
|
||||
- package: github.com/spf13/cobra
|
||||
version: ~0.0.1
|
||||
- package: github.com/spf13/viper
|
||||
version: ^1.0.0
|
||||
testImport:
|
||||
|
|
Loading…
Reference in New Issue