diff --git a/cmd/loop/main.go b/cmd/loop/main.go index d12fdea9..8921e1bb 100644 --- a/cmd/loop/main.go +++ b/cmd/loop/main.go @@ -201,7 +201,15 @@ func fatal(err error) { } func main() { - rootCmd := &cli.Command{ + rootCmd := newRootCommand() + if err := rootCmd.Run(context.Background(), os.Args); err != nil { + fatal(err) + } +} + +// newRootCommand constructs the CLI root command for loop. +func newRootCommand() *cli.Command { + return &cli.Command{ Name: "loop", Usage: "control plane for your loopd", Version: loop.RichVersion(), @@ -222,10 +230,6 @@ func main() { return cli.ShowRootCommandHelp(cmd) }, } - - if err := rootCmd.Run(context.Background(), os.Args); err != nil { - fatal(err) - } } // getClient establishes a SwapClient RPC connection and returns the client and