mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Merge pull request #916 from starius/loop-cli-prevent-unknown-flags
cmd/loop: crash if unknown flags are provided
This commit is contained in:
commit
ec2bf44e46
3 changed files with 3 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ var setLiquidityRuleCommand = cli.Command{
|
|||
Name: "setrule",
|
||||
Usage: "set liquidity manager rule for a channel/peer",
|
||||
Description: "Update or remove the liquidity rule for a channel/peer.",
|
||||
ArgsUsage: "{shortchanid | peerpubkey}",
|
||||
ArgsUsage: "{shortchanid | peerpubkey}",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "type",
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ func loopIn(ctx *cli.Context) error {
|
|||
switch {
|
||||
case ctx.IsSet("amt"):
|
||||
amtStr = ctx.String("amt")
|
||||
case ctx.NArg() > 0:
|
||||
case ctx.NArg() == 1:
|
||||
amtStr = args[0]
|
||||
default:
|
||||
// Show command help if no arguments and flags were provided.
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ func loopOut(ctx *cli.Context) error {
|
|||
switch {
|
||||
case ctx.IsSet("amt"):
|
||||
amtStr = ctx.String("amt")
|
||||
case ctx.NArg() > 0:
|
||||
case ctx.NArg() == 1 || ctx.NArg() == 2:
|
||||
amtStr = args[0]
|
||||
args = args.Tail()
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue