As a first step, I've implemented the options parsing using optparse rather than getopt.
This only partly takes us to where we want to get to.
I suggest creating a class called something like PQMConfig that encapsulates both the options from the commandline, and the ConfigParser that deals with the configuration files.
An instance of this is created early, used to parse the command line. It then reads the config files and provides a standard configuration object to pass around that provides access to the configuration state of PQM.
As a first step, I've implemented the options parsing using optparse rather than getopt.
This only partly takes us to where we want to get to.
I suggest creating a class called something like PQMConfig that encapsulates both the options from the commandline, and the ConfigParser that deals with the configuration files.
An instance of this is created early, used to parse the command line. It then reads the config files and provides a standard configuration object to pass around that provides access to the configuration state of PQM.