Skip to content

Commit

Permalink
add support for oem, vendor and prod_name in formated output
Browse files Browse the repository at this point in the history
  • Loading branch information
HikariKnight committed Apr 8, 2023
1 parent e1ca657 commit 1e41609
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions pkg/iommu/genoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ func GenDeviceLine(group int, device *pci.Device, pArg *params.Params) string {
formated_line = append(formated_line, fmt.Sprintf("%s %s", device.Vendor.Name, device.Product.Name))
case "name:":
formated_line = append(formated_line, fmt.Sprintf("%s %s:", device.Vendor.Name, device.Product.Name))
case "prod_name":
formated_line = append(formated_line, device.Product.Name)
case "prod_name:":
formated_line = append(formated_line, fmt.Sprintf("%s:", device.Product.Name))
case "oem":
formated_line = append(formated_line, device.Subsystem.Name)
case "oem:":
formated_line = append(formated_line, fmt.Sprintf("%s:", device.Subsystem.Name))
case "vendor":
formated_line = append(formated_line, device.Vendor.Name)
case "vendor:":
formated_line = append(formated_line, fmt.Sprintf("%s:", device.Vendor.Name))
case "device_id":
formated_line = append(formated_line, fmt.Sprintf("[%s:%s]", device.Vendor.ID, device.Product.ID))
case "device_id:":
Expand Down
2 changes: 1 addition & 1 deletion pkg/params/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewParams() *Params {

format := parser.String("F", "format", &argparse.Options{
Required: false,
Help: "Formats the device line output the way you want it (omit what you do not want)\n\t\t Supported objects: pciaddr, subclass_name, subclass_name:, subclass_id, subclass_id:, name, name:, device_id, device_id:, revision, optional_revision",
Help: "Formats the device line output the way you want it (omit what you do not want)\n\t\t Supported objects: pciaddr, subclass_name, subclass_name:, subclass_id, subclass_id:, name, name:, device_id, device_id:, vendor, vendor:, oem, oem:, prod_name, prod_name:, revision, optional_revision",
Default: "pciaddr,subclass_name,subclass_id,name,device_id,optional_revision",
})

Expand Down

0 comments on commit 1e41609

Please sign in to comment.