File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 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{
3131 "should be sent to, if let blank the funds " +
3232 "will go to lnd's wallet" ,
3333 },
34+ cli.Uint64Flag {
35+ Name : "amt" ,
36+ Usage : "the amount in satoshis to loop out" ,
37+ },
3438 },
3539 Action : loopOut ,
3640}
3741
3842func 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.
4154 cli .ShowCommandHelp (ctx , "out" )
4255 return nil
4356 }
4457
45- args := ctx .Args ()
46-
47- amt , err := parseAmt (args [0 ])
58+ amt , err := parseAmt (amtStr )
4859 if err != nil {
4960 return err
5061 }
51- args = args .Tail ()
5262
5363 var destAddr string
5464 switch {
You can’t perform that action at this time.
0 commit comments