Skip to content

Commit

Permalink
Merge pull request #273 from filecoin-project/feat/add_notice_for_no_…
Browse files Browse the repository at this point in the history
…flag

feat: add error notice for no specific flags
  • Loading branch information
diwufeiwen authored Feb 8, 2023
2 parents 40eb5d1 + f6469d7 commit 831d33d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/storage-cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,34 +160,42 @@ var storageDealSelectionRejectCmd = &cli.Command{
}
defer closer()

isUpdate := false
if cctx.Bool("online") {
err = smapi.DealsSetConsiderOnlineStorageDeals(DaemonContext(cctx), mAddr, false)
if err != nil {
return err
}
isUpdate = true
}

if cctx.Bool("offline") {
err = smapi.DealsSetConsiderOfflineStorageDeals(DaemonContext(cctx), mAddr, false)
if err != nil {
return err
}
isUpdate = true
}

if cctx.Bool("verified") {
err = smapi.DealsSetConsiderVerifiedStorageDeals(DaemonContext(cctx), mAddr, false)
if err != nil {
return err
}
isUpdate = true
}

if cctx.Bool("unverified") {
err = smapi.DealsSetConsiderUnverifiedStorageDeals(DaemonContext(cctx), mAddr, false)
if err != nil {
return err
}
isUpdate = true
}

if !isUpdate {
return errors.New("specify flag to update") //just tell user to use flag option
}
return nil
},
}
Expand Down

0 comments on commit 831d33d

Please sign in to comment.