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