@classmethod
def main(cls, argv):
    """The main entry point

        Parses command-line arguments, selects the actual command class to use
        based on them, and runs that command.

        :param argv: Command-line arguments.
        :return: Command exit code
        """
    if cls not in cls._option_parsers:
        cls.make_parser()
        cls._option_parsers[cls] = cls.option_parser
    options, args = cls.option_parser.parse_args(argv[1:])
    command_class = cls.get_command_class(options, args)
    command = command_class(options, args)
    return command.execute()
