mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd/loop: factor newRootCommand
This commit is contained in:
parent
74c7274b03
commit
3e9a99dd55
1 changed files with 9 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue