mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
refactor: extract root command creation to separate file
This commit is contained in:
+1
-6
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user