File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ func (c *AddContext) DefineCommand(...cmdparser.CommandOptions) {
2626 Examples : []cmdparser.ExampleOptions {
2727 {
2828 Description : "Add a default context" ,
29- Steps : []string {"sqlcmd config add-context --name my-context" }},
29+ Steps : []string {
30+ "sqlcmd config add-endpoint --name localhost-1433" ,
31+ "sqlcmd config add-context --name my-context --endpoint localhost-1433" }},
3032 },
3133 Run : c .run }
3234
Original file line number Diff line number Diff line change @@ -18,7 +18,16 @@ func AddContext(context Context) {
1818 if ! EndpointExists (context .Endpoint ) {
1919 panic ("Endpoint doesn't exist" )
2020 }
21+ << << << < Updated upstream
2122 context .Name = FindUniqueContextName (context .Name , * context .User )
23+ == == == =
24+ username := ""
25+ if context .User != nil && * context .User != "" {
26+ username = * context .User
27+ }
28+
29+ context .Name = FindUniqueContextName (context .Name , username )
30+ >> >> >> > Stashed changes
2231 config .Contexts = append (config .Contexts , context )
2332 Save ()
2433}
You can’t perform that action at this time.
0 commit comments