From 3dd05b9a603b1976f703f0619da4f5d65703d0d1 Mon Sep 17 00:00:00 2001 From: jbpaux <9682558+jbpaux@users.noreply.github.com> Date: Mon, 20 May 2019 17:08:11 +0200 Subject: [PATCH] Add shellType parameter to force a specific shell (bash or pwsh) --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 57162e1..0969a1a 100644 --- a/main.go +++ b/main.go @@ -16,11 +16,12 @@ import ( ) func main() { - var tenantID string + var tenantID, shellType string var reset, help bool flag.StringVar(&tenantID, "tenant", "", "Specify the tenant Id.") flag.BoolVar(&reset, "reset", false, "Reset the presisted tenant settings.") flag.BoolVar(&help, "help", false, "Show the help text.") + flag.StringVar(&shellType,"shelltype","","Force to request the specified shell type (bash|pwsh)") flag.Parse() if help { @@ -101,7 +102,12 @@ func main() { return } - t, err := RequestTerminal(tenantID, uri, css.Properties.PreferredShellType) + if ((shellType != "pwsh") && (shellType != "bash")) { + shellType = css.Properties.PreferredShellType + } + + + t, err := RequestTerminal(tenantID, uri, shellType) if err != nil || t.SocketURI == "" { fmt.Println("Failed to connect to cloud shell terminal.", err) return