refactor: extract root command creation to separate file

This commit is contained in:
Prad Nukala committed 2024-09-27 11:02:11 -04:00
1 parent 4463bf6ffb
commit 049ed32e33
2 files changed
+11 -6

No files matched your search

+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",
}
}