pldmtool: Implement GetFRURecordByOption

Implement GetFRURecordByOption

Tested:

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 0
...
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 5
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 3(Part Number)
	FRU Field Length: 7
	FRU Field Value: 02CY415
	FRU Field Type: 4(Serial Number)
	FRU Field Length: 12
	FRU Field Value: YA1934319126
	FRU Field Type: 5(Manufacturer)
	FRU Field Length: 3
	FRU Field Value: IBM
	FRU Field Type: 8(Name)
	FRU Field Length: 16
	FRU Field Value: PROCESSOR MODULE
	FRU Field Type: 10(Version)
	FRU Field Length: 2
	FRU Field Value: 22
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 4
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 2(Model)
	FRU Field Length: 20
	FRU Field Value: M393A2K43BB1-CTD
	FRU Field Type: 4(Serial Number)
	FRU Field Length: 10
	FRU Field Value: 0x367f4d92
	FRU Field Type: 5(Manufacturer)
	FRU Field Length: 19
	FRU Field Value: Samsung Electronics
	FRU Field Type: 8(Name)
	FRU Field Length: 32
	FRU Field Value: DDR4-2666 16GiB 64-bit ECC RDIMM
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 12
	FRU Field Value: powersupply0
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 12
	FRU Field Value: powersupply1

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 8
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 16
	FRU Field Value: PROCESSOR MODULE
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 32
	FRU Field Value: DDR4-2666 16GiB 64-bit ECC RDIMM
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 12
	FRU Field Value: powersupply0
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 8(Name)
	FRU Field Length: 12
	FRU Field Value: powersupply1

$pldmtool fru GetFRURecordByOption -i 0 -r 0 -f 4
FRU Record Set Identifier: 1
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 4(Serial Number)
	FRU Field Length: 12
	FRU Field Value: YA1934319126
FRU Record Set Identifier: 2
FRU Record Type: 1(General)
Number of FRU fields: 1
Encoding Type for FRU fields: 1(ASCII)
	FRU Field Type: 4(Serial Number)
	FRU Field Length: 10
	FRU Field Value: 0x367f4d92
FRU Record Set Identifier: 3
FRU Record Type: 1(General)
Number of FRU fields: 0
Encoding Type for FRU fields: 1(ASCII)
FRU Record Set Identifier: 4
FRU Record Type: 1(General)
Number of FRU fields: 0
Encoding Type for FRU fields: 1(ASCII)

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: Ia4bf6f938061dad69ab243704cfa9ac8da5fc80e
diff --git a/pldmtool/pldm_base_cmd.cpp b/pldmtool/pldm_base_cmd.cpp
index 8079850..bfcb38a 100644
--- a/pldmtool/pldm_base_cmd.cpp
+++ b/pldmtool/pldm_base_cmd.cpp
@@ -50,7 +50,8 @@
 
 const std::map<const char*, pldm_fru_commands> pldmFruCmds{
     {"GetFRURecordTableMetadata", PLDM_GET_FRU_RECORD_TABLE_METADATA},
-    {"GetFRURecordTable", PLDM_GET_FRU_RECORD_TABLE}};
+    {"GetFRURecordTable", PLDM_GET_FRU_RECORD_TABLE},
+    {"GetFRURecordByOption", PLDM_GET_FRU_RECORD_BY_OPTION}};
 
 #ifdef OEM_IBM
 const std::map<const char*, pldm_host_commands> pldmIBMHostCmds{