'Parse the command line args
This method parses the command line arguments.  It uses the parser
stored in the self.parser attribute and saves the args and options in
self.args and self.options respectively.
Subclasses need to implement this method.  They will usually create
a base_parser, add their own options to the base_parser, and then call
this method to do the actual parsing.  An implementation will look
something like this::
def parse(self):
parser = super(MyCLI, self).base_parser(usage="My Ansible CLI", inventory_opts=True)
parser.add_option(\'--my-option\', dest=\'my_option\', action=\'store\')
self.parser = parser
super(MyCLI, self).parse()
# If some additional transformations are needed for the
# arguments and options, do it here.'

@abstractmethod
def parse(self):

    (self.options, self.args) = self.parser.parse_args(self.args[1:])
    if (hasattr(self.options, 'tags') and (not self.options.tags)):
        self.options.tags = ['all']
    if (hasattr(self.options, 'tags') and self.options.tags):
        if (not C.MERGE_MULTIPLE_CLI_TAGS):
            if (len(self.options.tags) > 1):
                display.deprecated('Specifying    --tags    multiple    times    on    the    command    line    currently    uses    the    last    specified    value.    In    2.4,    values    will    be    merged    instead.        Set    merge_multiple_cli_tags=True    in    ansible.cfg    to    get    this    behavior    now.', version=2.5, removed=False)
                self.options.tags = [self.options.tags[(-1)]]
        tags = set()
        for tag_set in self.options.tags:
            for tag in tag_set.split(u','):
                tags.add(tag.strip())
        self.options.tags = list(tags)
    if (hasattr(self.options, 'skip_tags') and self.options.skip_tags):
        if (not C.MERGE_MULTIPLE_CLI_TAGS):
            if (len(self.options.skip_tags) > 1):
                display.deprecated('Specifying    --skip-tags    multiple    times    on    the    command    line    currently    uses    the    last    specified    value.    In    2.4,    values    will    be    merged    instead.        Set    merge_multiple_cli_tags=True    in    ansible.cfg    to    get    this    behavior    now.', version=2.5, removed=False)
                self.options.skip_tags = [self.options.skip_tags[(-1)]]
        skip_tags = set()
        for tag_set in self.options.skip_tags:
            for tag in tag_set.split(u','):
                skip_tags.add(tag.strip())
        self.options.skip_tags = list(skip_tags)
    if hasattr(self.options, 'inventory'):
        if self.options.inventory:
            if isinstance(self.options.inventory, string_types):
                self.options.inventory = [self.options.inventory]
            self.options.inventory = [(unfrackpath(opt) if (',' not in opt) else opt) for opt in self.options.inventory]
        elif os.path.exists(C.DEFAULT_HOST_LIST):
            self.options.inventory = [C.DEFAULT_HOST_LIST]
