Skip to content

Commit bf83a5e

Browse files
committed
Saving changes
1 parent 5529406 commit bf83a5e

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

cmd/modern/root.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func (c *Root) IsValidSubCommand(command string) bool {
8989
}
9090

9191
func (c *Root) addGlobalFlags() {
92+
93+
// BUG:(stuartpa) - This is a temporary flag until we have migrated
94+
// the kong impl to cobra. sqlcmd -? will show the kong help (all the back-compat
95+
// flags), sqlcmd --? will show the kong "did you mean one of" help.
9296
var unused bool
9397
c.AddFlag(cmdparser.FlagOptions{
9498
Bool: &unused,

cmd/modern/root/open/ads.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ func (c *Ads) DefineCommand(...cmdparser.CommandOptions) {
3838
func (c *Ads) run() {
3939
endpoint, user := config.CurrentContext()
4040

41-
hostname := endpoint.EndpointDetails.Address
42-
4341
// If the context has a local container, ensure it is running, otherwise bail out
4442
if endpoint.AssetDetails != nil && endpoint.AssetDetails.ContainerDetails != nil {
4543
c.ensureContainerIsRunning(endpoint)
4644
}
4745

46+
hostname := endpoint.EndpointDetails.Address
47+
4848
// If the hostname is localhost, ADS will not connect to the container
4949
// because it will try to connect to the host machine. To work around
5050
// BUG(stuartpa): I think this might be a bug in ADS?
@@ -75,7 +75,6 @@ func (c *Ads) ensureContainerIsRunning(endpoint sqlconfig.Endpoint) {
7575
// launchAds launches the Azure Data Studio using the specified server and username.
7676
func (c *Ads) launchAds(host string, port int, username string) {
7777
output := c.Output()
78-
7978
args := []string{
8079
"-r",
8180
fmt.Sprintf(

internal/config/context.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ func AddContext(context Context) string {
2020
if !EndpointExists(context.Endpoint) {
2121
panic("Endpoint doesn't exist")
2222
}
23-
2423
username := ""
25-
if context.User != nil && *context.User != "" {
24+
if context.User != nil {
2625
username = *context.User
2726
}
2827
context.Name = FindUniqueContextName(context.Name, username)
2928

29+
// The command line parser sets user by default to "", in the case there
30+
// is no user (therefore Windows Authentication), we omit the
31+
// user from the sqlconfig file yaml by setting it to nil here.
3032
if context.User != nil && *context.User == "" {
3133
context.User = nil
3234
}

internal/keyring/keyring.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)