def do_list(self, arg):
        '''List mail in specified folder.'''

        try:
            args = docopt.docopt('\n'.join([
                'Usage: list [options] [<directory>]',
                '',
                'Options:',
                '    -l, --limit=<LIMIT>    Limit number of mail displayed',
                '    -h, --help             Show this message',
            ]), argv=arg)
        except __HOLE__:
            return

        try:
            limit = int(args['--limit'] or 10)
        except ValueError:
            limit = 10
        for mail_info in search.fetch_mails_info(self.imap_account,
                                                 limit=limit):
            sys.stdout.write(
                u'UID : {:<10} From : {:<40.40} Subject : {:.50}\n'.format(
                    mail_info['uid'],
                    mail_info['from'],
                    mail_info['subject']))
dataset/ETHPy150Open Gentux/imap-cli/imap_cli/scripts/imap_shell.py/ImapShell.do_list