retrieval: Check required flags for --car-export-merkle-proof

This commit is contained in:
Łukasz Magiera 2021-11-29 21:39:18 +01:00
parent 410ecb4bbc
commit e4f47de6ef

View File

@ -290,6 +290,12 @@ Examples:
return ShowHelp(cctx, fmt.Errorf("incorrect number of arguments"))
}
if cctx.Bool("car-export-merkle-proof") {
if !cctx.Bool("car") && !cctx.IsSet("data-selector") {
return ShowHelp(cctx, fmt.Errorf("--car-export-merkle-proof requires --car and --data-selector"))
}
}
fapi, closer, err := GetFullNodeAPIV1(cctx)
if err != nil {
return err