Skip to content

Commit 6982adb

Browse files
sputn1ckhieblmi
authored andcommitted
cmd/staticaddr: hide behind build flag
1 parent c2281b8 commit 6982adb

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

cmd/loop/main.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ var (
7676
Name: "verbose, v",
7777
Usage: "show expanded details",
7878
}
79+
80+
commands = []cli.Command{
81+
loopOutCommand, loopInCommand, termsCommand,
82+
monitorCommand, quoteCommand, listAuthCommand, fetchL402Command,
83+
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
84+
setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand,
85+
getInfoCommand, abandonSwapCommand, reservationsCommands,
86+
instantOutCommand, listInstantOutsCommand,
87+
}
7988
)
8089

8190
const (
@@ -142,15 +151,7 @@ func main() {
142151
tlsCertFlag,
143152
macaroonPathFlag,
144153
}
145-
app.Commands = []cli.Command{
146-
loopOutCommand, loopInCommand, termsCommand,
147-
monitorCommand, quoteCommand, listAuthCommand, fetchL402Command,
148-
listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand,
149-
setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand,
150-
getInfoCommand, abandonSwapCommand, reservationsCommands,
151-
instantOutCommand, listInstantOutsCommand,
152-
staticAddressCommands,
153-
}
154+
app.Commands = commands
154155

155156
err := app.Run(os.Args)
156157
if err != nil {

cmd/loop/staticaddr.go

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build staticaddr
2+
// +build staticaddr
3+
14
package main
25

36
import (
@@ -18,6 +21,10 @@ import (
1821
"github.com/urfave/cli"
1922
)
2023

24+
func init() {
25+
commands = append(commands, staticAddressCommands)
26+
}
27+
2128
var staticAddressCommands = cli.Command{
2229
Name: "static",
2330
ShortName: "s",

0 commit comments

Comments
 (0)