2023-07-25 18:19:07 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/databricks/cli/cmd/account"
|
2023-07-27 10:03:08 +00:00
|
|
|
"github.com/databricks/cli/cmd/api"
|
|
|
|
"github.com/databricks/cli/cmd/auth"
|
|
|
|
"github.com/databricks/cli/cmd/bundle"
|
|
|
|
"github.com/databricks/cli/cmd/configure"
|
|
|
|
"github.com/databricks/cli/cmd/fs"
|
2023-07-25 18:19:07 +00:00
|
|
|
"github.com/databricks/cli/cmd/root"
|
2023-07-27 10:03:08 +00:00
|
|
|
"github.com/databricks/cli/cmd/sync"
|
|
|
|
"github.com/databricks/cli/cmd/version"
|
2023-07-25 18:19:07 +00:00
|
|
|
"github.com/databricks/cli/cmd/workspace"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func New() *cobra.Command {
|
2023-07-27 10:03:08 +00:00
|
|
|
cli := root.New()
|
|
|
|
|
|
|
|
// Add account subcommand.
|
|
|
|
cli.AddCommand(account.New())
|
|
|
|
|
|
|
|
// Add workspace subcommands.
|
|
|
|
for _, cmd := range workspace.All() {
|
|
|
|
cli.AddCommand(cmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add workspace command groups.
|
|
|
|
groups := workspace.Groups()
|
|
|
|
for i := range groups {
|
|
|
|
cli.AddGroup(&groups[i])
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add other subcommands.
|
|
|
|
cli.AddCommand(api.New())
|
|
|
|
cli.AddCommand(auth.New())
|
|
|
|
cli.AddCommand(bundle.New())
|
|
|
|
cli.AddCommand(configure.New())
|
|
|
|
cli.AddCommand(fs.New())
|
|
|
|
cli.AddCommand(sync.New())
|
|
|
|
cli.AddCommand(version.New())
|
|
|
|
|
|
|
|
return cli
|
2023-07-25 18:19:07 +00:00
|
|
|
}
|