I have the following options
parser = OptionParser()
parser.add_option('-a', '--all', action='store_true', dest='all', help='writes all header information')
parser.add_option('-h', '--file-header', action='store_true', dest='head', help='prints the elf file header information')
parser.add_option('-l', '--program-header', action='store_true', dest='prog', help='prints the program header')
parser.add_option('-S', '--section-header', action='store_true', dest='sec', help='prints the section header')
When you run the script, an error message appears:
optparse.OptionConflictError: option -h/--file-header: conflicting option string(s): -h
I know that usually -h is reserved for displaying help. But I'm trying to write an ELF file read for some special elf files, and therefore I want to use the same commands as readelf. And readelf uses -h to print header information.
Is it possible to overwrite the -h parameter in the parameter parser or is this fixed?
source
share