'tables ?PATTERN?: Lists names of tables matching LIKE pattern
This also returns views.'

def command_tables(self, cmd):

    self.push_output()
    self.output = self.output_list
    self.header = False
    try:
        if (len(cmd) == 0):
            cmd = ['%']
        for n in cmd:
            self.process_sql("SELECT    name    FROM    sqlite_master    WHERE    type    IN    ('table',    'view')    AND    name    NOT    LIKE    'sqlite_%'    AND    name    like    ?1    UNION    ALL    SELECT    name    FROM    sqlite_temp_master    WHERE    type    IN    ('table',    'view')    AND    name    NOT    LIKE    'sqlite_%'    ORDER    BY    1", (n,), internal=True)
    finally:
        self.pop_output()
