docs: def cmd(send, msg, args):
      """Greps the log for a string.
  
      Syntax: {command} [--nick <nick>] [--ignore-case/-i] <string>
  
      """
      parser = arguments.ArgParser(args['config'])
      parser.add_argument('--nick', action=arguments.NickParser)
      parser.add_argument('--ignore-case', '-i', action='store_true')
      parser.add_argument('string', nargs='*')
      try:
          cmdargs = parser.parse_args(msg)
      except arguments.ArgumentException as e:
          send(str(e))
          return
      if not cmdargs.string:
          send('Please specify a search term.')
          return
      cmdchar = args['config']['core']['cmdchar']
      term = ' '.join(cmdargs.string)
      if cmdargs.nick:
          query = args['db'].query(Log).filter(Log.type == 'pubmsg', Log.source == cmdargs.nick, ~Log.msg.startswith(cmdchar))
      else:
          query = args['db'].query(Log).filter(Log.type == 'pubmsg', ~Log.msg.startswith(cmdchar))
      if cmdargs.ignore_case:
          query = query.filter(Log.msg.ilike('%%%s%%' % escape(term)))
      else:
          query = query.filter(Log.msg.like('%%%s%%' % escape(term)))
      query = query.order_by(Log.time.desc())
      result = query.limit(1).first()
      count = query.count()
      if result is not None:
          logtime = result.time.strftime('%Y-%m-%d %H:%M:%S')
          send("%s was last said by %s at %s (%d occurrences)" % (result.msg, result.source, logtime, count))
      elif cmdargs.nick:
          send('%s has never said %s.' % (cmdargs.nick, term))
      else:
          send('%s has never been said.' % term)