From ac556d593e827e8b69ed2d850e3f7bebcac53261 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 21 Aug 2023 19:53:35 +0200 Subject: [PATCH] Add full output flag to get logins command --- cmd/logins.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/logins.go b/cmd/logins.go index 25788a3..ce6089d 100644 --- a/cmd/logins.go +++ b/cmd/logins.go @@ -29,6 +29,7 @@ var getLoginCmd = &cobra.Command{ uuid, _ := cmd.Flags().GetString("uuid") name, _ := cmd.Flags().GetString("name") username, _ := cmd.Flags().GetString("username") + fullOutput, _ := cmd.Flags().GetBool("full") resp, err := commandClient.SendToAgent(ipc.GetLoginRequest{ Name: name, @@ -44,7 +45,11 @@ var getLoginCmd = &cobra.Command{ switch resp.(type) { case ipc.GetLoginResponse: response := resp.(ipc.GetLoginResponse) - fmt.Println(response.Result.Password) + if fullOutput { + fmt.Println(response.Result) + } else { + fmt.Println(response.Result.Password) + } break case ipc.ActionResponse: println("Error: " + resp.(ipc.ActionResponse).Message) @@ -59,4 +64,5 @@ func init() { getLoginCmd.PersistentFlags().String("name", "", "") getLoginCmd.PersistentFlags().String("username", "", "") getLoginCmd.PersistentFlags().String("uuid", "", "") + getLoginCmd.PersistentFlags().Bool("full", false, "") }