-
Notifications
You must be signed in to change notification settings - Fork 57
/
install.go
37 lines (30 loc) · 1018 Bytes
/
install.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package root
import (
"github.com/microsoft/go-sqlcmd/cmd/modern/root/install"
"github.com/microsoft/go-sqlcmd/internal/cmdparser"
"github.com/microsoft/go-sqlcmd/internal/localizer"
)
// Install defines the `sqlcmd install` sub-commands
type Install struct {
cmdparser.Cmd
}
func (c *Install) DefineCommand(...cmdparser.CommandOptions) {
options := cmdparser.CommandOptions{
Use: "create",
Short: localizer.Sprintf("Install/Create SQL Server, Azure SQL, and Tools"),
Aliases: []string{"install"},
SubCommands: c.SubCommands(),
}
c.Cmd.DefineCommand(options)
}
// SubCommands sets up the sub-commands for `sqlcmd install` such as
// `sqlcmd install mssql` and `sqlcmd install azsql-edge`
func (c *Install) SubCommands() []cmdparser.Command {
dependencies := c.Dependencies()
return []cmdparser.Command{
cmdparser.New[*install.Mssql](dependencies),
cmdparser.New[*install.Edge](dependencies),
}
}