'Main entry point of the command-line interface.
:param argv: list of arguments passed on the command-line'

def run(self, argv=sys.argv):

    self.parser = OptionParser(usage=(self.usage % ('command', '[args]')), version=self.version)
    self.parser.disable_interspersed_args()
    self.parser.print_help = self._help
    self.parser.add_option('--list-locales', dest='list_locales', action='store_true', help='print    all    known    locales    and    exit')
    self.parser.add_option('-v', '--verbose', action='store_const', dest='loglevel', const=logging.DEBUG, help='print    as    much    as    possible')
    self.parser.add_option('-q', '--quiet', action='store_const', dest='loglevel', const=logging.ERROR, help='print    as    little    as    possible')
    self.parser.set_defaults(list_locales=False, loglevel=logging.INFO)
    (options, args) = self.parser.parse_args(argv[1:])
    self._configure_logging(options.loglevel)
    if options.list_locales:
        identifiers = localedata.list()
        longest = max([len(identifier) for identifier in identifiers])
        identifiers.sort()
        format = (u'%%-%ds    %%s' % (longest + 1))
        for identifier in identifiers:
            locale = Locale.parse(identifier)
            output = (format % (identifier, locale.english_name))
            print output.encode((sys.stdout.encoding or getpreferredencoding() or 'ascii'), 'replace')
        return 0
    if (not args):
        self.parser.error('no    valid    command    or    option    passed.    Try    the    -h/--help    option    for    more    information.')
    cmdname = args[0]
    if (cmdname not in self.commands):
        self.parser.error(('unknown    command    "%s"' % cmdname))
    return getattr(self, cmdname)(args[1:])
