cosmos-sdk/docs/sdk/sdk-by-examples/simple-governance/app-cli.md

791 B

Application CLI

File: cmd/simplegovcli/maing.go

To interact with our application, let us add the commands from the simple_governance module to our simpleGov application, as well as the pre-built SDK commands:

//  cmd/simplegovcli/main.go
...
	rootCmd.AddCommand(
		client.GetCommands(
			simplegovcmd.GetCmdQueryProposal("proposals", cdc),
			simplegovcmd.GetCmdQueryProposals("proposals", cdc),
			simplegovcmd.GetCmdQueryProposalVotes("proposals", cdc),
			simplegovcmd.GetCmdQueryProposalVote("proposals", cdc),
		)...)
	rootCmd.AddCommand(
		client.PostCommands(
			simplegovcmd.PostCmdPropose(cdc),
			simplegovcmd.PostCmdVote(cdc),
		)...)
...