From 36c3086376ee760d1caefc9ebae119d75e7be7a0 Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Fri, 26 Mar 2021 09:48:50 +0530 Subject: [PATCH] changes as per review --- cli/client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/client.go b/cli/client.go index ecc31e1e5..787510821 100644 --- a/cli/client.go +++ b/cli/client.go @@ -95,7 +95,6 @@ var clientCmd = &cli.Command{ WithCategory("util", clientListTransfers), WithCategory("util", clientRestartTransfer), WithCategory("util", clientCancelTransfer), - WithCategory("util", clientCancelRetrievalDeal), }, } @@ -952,6 +951,9 @@ var clientRetrieveCmd = &cli.Command{ Name: "retrieve", Usage: "Retrieve data from network", ArgsUsage: "[dataCid outputPath]", + Subcommands: []*cli.Command{ + clientCancelRetrievalDeal, + }, Flags: []cli.Flag{ &cli.StringFlag{ Name: "from", @@ -1977,7 +1979,7 @@ var clientCancelTransfer = &cli.Command{ } var clientCancelRetrievalDeal = &cli.Command{ - Name: "cancel-retrieval-deal", + Name: "cancel", Usage: "Cancel a retrieval deal by DealID", Flags: []cli.Flag{ &cli.Int64Flag{ @@ -1994,8 +1996,8 @@ var clientCancelRetrievalDeal = &cli.Command{ defer closer() ctx := ReqContext(cctx) - if cctx.Int64("dealid") == 0 { - return errors.New("deal id cannot be 0") + if cctx.Int64("dealid") <= 0 { + return errors.New("deal id cannot be negative") } return api.ClientCancelRetrievalDeal(ctx, retrievalmarket.DealID(cctx.Int64("dealid")))