'Parse command line arguments.'

def parse_args(self):

    args = self.init_args().parse_args()
    self.config = Config(args.conf_file)
    if args.debug:
        from logging import DEBUG
        logger.setLevel(DEBUG)
    if (args.port is None):
        if args.webserver:
            args.port = self.web_server_port
        else:
            args.port = self.server_port
    if (args.client is not None):
        (args.client, args.port) = ((x if x else y) for (x, y) in zip(args.client.partition(':')[::2], (args.client, args.port)))
    if args.disable_autodiscover:
        logger.info('Auto    discover    mode    is    disabled')
    if WINDOWS:
        args.webserver = True
    if args.webserver:
        args.process_short_name = True
    if args.username_prompt:
        args.password_prompt = True
        if args.server:
            args.username = self.__get_username(description='Define    the    Glances    server    username:    ')
        elif args.webserver:
            args.username = self.__get_username(description='Define    the    Glances    webserver    username:    ')
        elif args.client:
            args.username = self.__get_username(description='Enter    the    Glances    server    username:    ')
    else:
        args.username = self.username
    if args.password_prompt:
        if args.server:
            args.password = self.__get_password(description='Define    the    Glances    server    password    ({}    username):    '.format(args.username), confirm=True, username=args.username)
        elif args.webserver:
            args.password = self.__get_password(description='Define    the    Glances    webserver    password    ({}    username):    '.format(args.username), confirm=True, username=args.username)
        elif args.client:
            args.password = self.__get_password(description='Enter    the    Glances    server    password    ({}    username):    '.format(args.username), clear=True, username=args.username)
    else:
        args.password = self.password
    args.help_tag = False
    args.network_sum = False
    args.network_cumul = False
    if args.full_quicklook:
        logger.info('Disable    QuickLook    menu')
        args.disable_quicklook = False
        args.disable_cpu = True
        args.disable_mem = True
        args.disable_memswap = True
        args.disable_load = False
    if args.disable_top:
        logger.info('Disable    top    menu')
        args.disable_quicklook = True
        args.disable_cpu = True
        args.disable_mem = True
        args.disable_memswap = True
        args.disable_load = True
    self.args = args
    export_tag = any([getattr(args, a) for a in args.__dict__ if a.startswith('export_')])
    if (WINDOWS and export_tag):
        logger.info('On    Windows    OS,    export    disable    the    Web    interface')
        self.args.quiet = True
        self.args.webserver = False
    elif ((not (self.is_standalone() or self.is_client())) and export_tag):
        logger.critical('Export    is    only    available    in    standalone    or    client    mode')
        sys.exit(2)
    if ((args.process_filter is not None) and (not self.is_standalone())):
        logger.critical('Process    filter    is    only    available    in    standalone    mode')
        sys.exit(2)
    if (args.export_graph and (args.path_graph is not None)):
        if (not os.access(args.path_graph, os.W_OK)):
            logger.critical("Graphs    output    path    {}    doesn't    exist    or    is    not    writable".format(args.path_graph))
            sys.exit(2)
        logger.debug('Graphs    output    path    is    set    to    {}'.format(args.path_graph))
    if (args.export_graph and args.disable_history):
        logger.critical('Can    not    export    graph    if    history    is    disabled')
        sys.exit(2)
    if args.disable_sensors:
        args.disable_hddtemp = True
        logger.debug('Sensors    and    HDDTemp    are    disabled')
    return args
