def phone_subcommand(search_terms, vcard_list, parsable):
all_phone_numbers_list = []<EOL>matching_phone_number_list = []<EOL>for vcard in vcard_list:<EOL><INDENT>for type, number_list in sorted(vcard.get_phone_numbers().items(),<EOL>key=lambda k: k[<NUM_LIT:0>].lower()):<EOL><INDENT>for number in sorted(number_list):<EOL><INDENT>if config.display_by_name() == "<STR_LIT>":<EOL><INDENT>name = vcard.get_first_name_last_name()<EOL><DEDENT>else:<EOL><INDENT>name = vcard.get_last_name_first_name()<EOL><DEDENT>line_formatted = "<STR_LIT:\t>".join([name, type, number])<EOL>line_parsable = "<STR_LIT:\t>".join([number, name, type])<EOL>if parsable:<EOL><INDENT>phone_number_line = line_parsable<EOL><DEDENT>else:<EOL><INDENT>phone_number_line = line_formatted<EOL><DEDENT>if re.search(search_terms,<EOL>"<STR_LIT>" % (line_formatted, line_parsable),<EOL>re.IGNORECASE | re.DOTALL):<EOL><INDENT>matching_phone_number_list.append(phone_number_line)<EOL><DEDENT>elif len(re.sub("<STR_LIT>", "<STR_LIT>", search_terms)) >= <NUM_LIT:3>:<EOL><INDENT>if re.search(re.sub("<STR_LIT>", "<STR_LIT>", search_terms),<EOL>re.sub("<STR_LIT>", "<STR_LIT>", number), re.IGNORECASE):<EOL><INDENT>matching_phone_number_list.append(phone_number_line)<EOL><DEDENT><DEDENT>all_phone_numbers_list.append(phone_number_line)<EOL><DEDENT><DEDENT><DEDENT>if matching_phone_number_list:<EOL><INDENT>if parsable:<EOL><INDENT>print('<STR_LIT:\n>'.join(matching_phone_number_list))<EOL><DEDENT>else:<EOL><INDENT>list_phone_numbers(matching_phone_number_list)<EOL><DEDENT><DEDENT>elif all_phone_numbers_list:<EOL><INDENT>if parsable:<EOL><INDENT>print('<STR_LIT:\n>'.join(all_phone_numbers_list))<EOL><DEDENT>else:<EOL><INDENT>list_phone_numbers(all_phone_numbers_list)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not parsable:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Print a phone application friendly contact table.

    :param search_terms: used as search term to filter the contacts before
        printing
    :type search_terms: str
    :param vcard_list: the vcards to search for matching entries which should
        be printed
    :type vcard_list: list of carddav_object.CarddavObject
    :param parsable: machine readable output: columns devided by tabulator (\t)
    :type parsable: bool
    :returns: None
    :rtype: None