From 452e790e0e1037baa1afbaf9d1e0050e77423f62 Mon Sep 17 00:00:00 2001 From: jay Date: Wed, 6 Mar 2019 16:24:30 -0800 Subject: [PATCH] added ability to switch to a service account as you enter it --- peirates.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/peirates.go b/peirates.go index f7822ea..7e6f235 100644 --- a/peirates.go +++ b/peirates.go @@ -865,7 +865,7 @@ func banner(connectionString ServerInfo) { ,,,,,,,,,,,,:.............,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ________________________________________ - Peirates v1.0.15 by InGuardians + Peirates v1.0.16 by InGuardians https://www.inguardians.com/peirates ----------------------------------------------------------------`) @@ -1124,7 +1124,21 @@ Peirates:># `) fmt.Printf("Selected %s // %s\n", connectionString.TokenName, connectionString.Token) } case "3": - serviceAccounts = append(serviceAccounts, acceptServiceAccountFromUser()) + serviceAccount := acceptServiceAccountFromUser() + serviceAccounts = append(serviceAccounts, serviceAccount) + + println("\n[1] Switch to this service account\n[2] Maintain current service account") + fmt.Scanln(&input) + switch input { + case "1": + assignServiceAccountToConnection(serviceAccount, &connectionString) + break + case "2": + break + default: + println("Input not understood - adding service account but not switching context") + } + println("") case "4": serviceAccountJSON, err := json.Marshal(serviceAccounts) if err != nil {