26 lines
500 B
Go
26 lines
500 B
Go
package keys
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
// listKeysCmd represents the list command
|
|
var listKeysCmd = &cobra.Command{
|
|
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
|
|
}
|