File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -31,24 +31,34 @@ var loopOutCommand = cli.Command{
31
31
"should be sent to, if let blank the funds " +
32
32
"will go to lnd's wallet" ,
33
33
},
34
+ cli.Uint64Flag {
35
+ Name : "amt" ,
36
+ Usage : "the amount in satoshis to loop out" ,
37
+ },
34
38
},
35
39
Action : loopOut ,
36
40
}
37
41
38
42
func loopOut (ctx * cli.Context ) error {
39
- // Show command help if no arguments and flags were provided.
40
- if ctx .NArg () < 1 {
43
+ args := ctx .Args ()
44
+
45
+ var amtStr string
46
+ switch {
47
+ case ctx .IsSet ("amt" ):
48
+ amtStr = ctx .String ("amt" )
49
+ case ctx .NArg () > 0 :
50
+ amtStr = args [0 ]
51
+ args = args .Tail ()
52
+ default :
53
+ // Show command help if no arguments and flags were provided.
41
54
cli .ShowCommandHelp (ctx , "out" )
42
55
return nil
43
56
}
44
57
45
- args := ctx .Args ()
46
-
47
- amt , err := parseAmt (args [0 ])
58
+ amt , err := parseAmt (amtStr )
48
59
if err != nil {
49
60
return err
50
61
}
51
- args = args .Tail ()
52
62
53
63
var destAddr string
54
64
switch {
You can’t perform that action at this time.
0 commit comments