(self, opt_name, opt_list, consumed, opt_multiple)
return False
Get command line options such as: -x -x= --x --x=
        The options may exist in the first and third part of the udocker
        command line.
Get command line options such as: -x -x= --x --x=
        The options may exist in the first and third part of the udocker
        command line.
Get command line options such as : - x - x = -- x -- x = The options may exist in the first and third part of the udocker command line .
def _get_option(self, opt_name, opt_list, consumed, opt_multiple):
        """Get command line options such as: -x -x= --x --x=
        The options may exist in the first and third part of the udocker
        command line.
        """
        all_args = []
        pos = 0
        list_len = len(opt_list)
        while pos < list_len:
            opt_arg = None
            if ((not opt_list[pos].startswith('-')) and
                    (pos < 1 or (pos not in consumed and not
                                 opt_list[pos-1].endswith('=')))):
                break        # end of options and start of arguments

            if opt_name.endswith('='):
                if opt_list[pos].startswith(opt_name):
                    opt_arg = opt_list[pos].split('=', 1)[1].strip()
                elif (opt_list[pos] == opt_name[:-1] and
                      pos + 1 == list_len):
                    break    # error --arg at end of line
                elif (opt_list[pos] == opt_name[:-1] and
                      not opt_list[pos + 1].startswith('-')):
                    consumed.append(pos)
                    pos += 1
                    opt_arg = opt_list[pos]
            elif opt_list[pos] == opt_name:
                consumed.append(pos)
                opt_arg = True

            pos += 1
            if opt_arg is None:
                continue

            consumed.append(pos-1)
            if opt_multiple:
                all_args.append(opt_arg)
            else:
                return opt_arg

        if opt_multiple:
            return all_args

        return False
def _get_option ( self , opt_name , opt_list , consumed , opt_multiple ) : all_args = [ ] pos = 0 list_len = len ( opt_list ) while pos < list_len : opt_arg = None if ( ( not opt_list [ pos ] . startswith ( '-' ) ) and ( pos < 1 or ( pos not in consumed and not opt_list [ pos - 1 ] . endswith ( '=' ) ) ) ) : break # end of options and start of arguments if opt_name . endswith ( '=' ) : if opt_list [ pos ] . startswith ( opt_name ) : opt_arg = opt_list [ pos ] . split ( '=' , 1 ) [ 1 ] . strip ( ) elif ( opt_list [ pos ] == opt_name [ : - 1 ] and pos + 1 == list_len ) : break # error --arg at end of line elif ( opt_list [ pos ] == opt_name [ : - 1 ] and not opt_list [ pos + 1 ] . startswith ( '-' ) ) : consumed . append ( pos ) pos += 1 opt_arg = opt_list [ pos ] elif opt_list [ pos ] == opt_name : consumed . append ( pos ) opt_arg = True pos += 1 if opt_arg is None : continue consumed . append ( pos - 1 ) if opt_multiple : all_args . append ( opt_arg ) else : return opt_arg if opt_multiple : return all_args return False