mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 18:31:41 +00:00
refactor: extract root command creation to separate file
This commit is contained in:
+1
-6
@@ -1,12 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := NewRootCmd()
|
||||||
Use: "motr",
|
|
||||||
Short: "Manage a local DWN instance for the Sonr blockchain",
|
|
||||||
}
|
|
||||||
rootCmd.AddCommand(NewProxyCmd())
|
rootCmd.AddCommand(NewProxyCmd())
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
panic(err)
|
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