cosmos-sdk/client/keys/list.go

26 lines
500 B
Go
Raw Normal View History

2018-02-22 07:17:19 -08:00
package keys
import "github.com/spf13/cobra"
2018-02-22 08:20:25 -08:00
// listKeysCmd represents the list command
var listKeysCmd = &cobra.Command{
2018-02-22 07:17:19 -08:00
Use: "list",
Short: "List all keys",
Long: `Return a list of all public keys stored by this key manager
along with their associated name and address.`,
RunE: runListCmd,
}
func runListCmd(cmd *cobra.Command, args []string) error {
kb, err := GetKeyBase()
if err != nil {
return err
}
infos, err := kb.List()
if err == nil {
printInfos(infos)
}
return err
}