refactor: extract root command creation to separate file

This commit is contained in:
Prad Nukala
2024-09-27 11:02:11 -04:00
parent 4463bf6ffb
commit 049ed32e33
2 changed files with 11 additions and 6 deletions
+1 -6
View File
@@ -1,12 +1,7 @@
package main
import "github.com/spf13/cobra"
func main() {
rootCmd := &cobra.Command{
Use: "motr",
Short: "Manage a local DWN instance for the Sonr blockchain",
}
rootCmd := NewRootCmd()
rootCmd.AddCommand(NewProxyCmd())
if err := rootCmd.Execute(); err != nil {
panic(err)
+10
View File
@@ -0,0 +1,10 @@
package main
import "github.com/spf13/cobra"
func NewRootCmd() *cobra.Command {
return &cobra.Command{
Use: "motr",
Short: "Manage a local DWN instance for the Sonr blockchain",
}
}