- optparser = OptionParser(
- usage='usage: %prog [-hrtp] [-d <pci id file] <elf-file>',
- description="Dump pmd hardware support info",
- add_help_option=True)
- optparser.add_option('-r', '--raw',
- action='store_true', dest='raw_output',
- help='Dump raw json strings')
- optparser.add_option("-d", "--pcidb", dest="pcifile",
- help="specify a pci database "
- "to get vendor names from",
- default=pcifile_default, metavar="FILE")
- optparser.add_option("-t", "--table", dest="tblout",
- help="output information on hw support as a "
- "hex table",
- action='store_true')
- optparser.add_option("-p", "--plugindir", dest="pdir",
- help="scan dpdk for autoload plugins",
- action='store_true')
-
- options, args = optparser.parse_args()
-
- if options.raw_output:
+ parser = argparse.ArgumentParser(
+ usage='usage: %(prog)s [-hrtp] [-d <pci id file>] elf_file',
+ description="Dump pmd hardware support info")
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('-r', '--raw',
+ action='store_true', dest='raw_output',
+ help='dump raw json strings')
+ group.add_argument("-t", "--table", dest="tblout",
+ help="output information on hw support as a hex table",
+ action='store_true')
+ parser.add_argument("-d", "--pcidb", dest="pcifile",
+ help="specify a pci database to get vendor names from",
+ default=pcifile_default, metavar="FILE")
+ parser.add_argument("-p", "--plugindir", dest="pdir",
+ help="scan dpdk for autoload plugins",
+ action='store_true')
+ parser.add_argument("elf_file", help="driver shared object file")
+ args = parser.parse_args()
+
+ if args.raw_output: