Make shell commands accessible at the top level
Change-Id: I1ce58d11d2b4b5a62464dbcf4c1d6f50458cd4f7
diff --git a/cmd/sb/sb2/commands/commands.go b/cmd/sb/sb2/commands/commands.go
index cef5330..a6a582e 100644
--- a/cmd/sb/sb2/commands/commands.go
+++ b/cmd/sb/sb2/commands/commands.go
@@ -9,7 +9,7 @@
"v.io/x/ref/lib/v23cmd"
)
-var commands = []*cmdline.Command{
+var Commands = []*cmdline.Command{
&cmdline.Command{
Name: "dump",
Short: "Print a dump of the database",
@@ -34,7 +34,7 @@
func dummyShutdown() {}
func GetCommand(name string) (*cmdline.Command, error) {
- for _, cmd := range commands {
+ for _, cmd := range Commands {
if cmd.Name == name {
return cmd, nil
}
diff --git a/cmd/sb/sb2/main.go b/cmd/sb/sb2/main.go
index e2b2267..9e4cf33 100644
--- a/cmd/sb/sb2/main.go
+++ b/cmd/sb/sb2/main.go
@@ -4,6 +4,7 @@
"regexp"
"v.io/x/lib/cmdline"
+ "v.io/x/ref/cmd/sb/sb2/commands"
_ "v.io/x/ref/runtime/factories/generic"
)
@@ -23,7 +24,7 @@
Syncbase general-purpose client and management utility.
Supports starting a syncQL shell and executing the commands at top level.
`,
- Children: []*cmdline.Command{cmdSbShell},
+ Children: append([]*cmdline.Command{cmdSbShell}, commands.Commands...),
}
var (