Add JSON formatted output for authenticate password cli command (#402)
This commit is contained in:
1 parent
874a7180ea
commit
9e6c016223
1 file changed
+8
@@ -145,6 +145,14 @@ func (c *PasswordCommand) Run(args []string) int {
|
||||
fmt.Sprintf(" Token: %s", token.Token),
|
||||
fmt.Sprintf(" User ID: %s", token.UserId),
|
||||
}))
|
||||
|
||||
case "json":
|
||||
jsonOut, err := base.JsonFormatter{}.Format(result)
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Errorf("Error formatting as JSON: %w", err).Error())
|
||||
return 1
|
||||
}
|
||||
c.UI.Output(string(jsonOut))
|
||||
}
|
||||
|
||||
tokenName := "default"
|
||||
|
||||
Reference in new issue
Block a user