def main(argv=None):

  if argv is None:
    argv = sys.argv

  try:
    opts, args = getopt.getopt(argv[1:], 'dhs', ['nodelay', 'help', 'size'])
  except getopt.error, msg:
    raise Usage(msg)

  # Print usage and return, regardless of presence of other args.
  for opt, _ in opts:
    if opt in ('-h', '--help'):
      print __doc__
      print help_msg
      return 0

  isdelay = False
  for opt, _ in opts:
    # Prints the size of the terminal and returns.
    # Mutually exclusive to the paging of text and overrides that behaviour.
    if opt in ('-s', '--size'):
      print 'Length: %d, Width: %d' % TerminalSize()
      return 0
    elif opt in ('-d', '--delay'):
      isdelay = True
    else:
      raise Usage('Invalid arguments.')

  # Page text supplied in either specified file or stdin.
  if len(args) == 1:
    fd = open(args[0]).read()
  else:
    fd = sys.stdin.read()
  Pager(fd, delay=isdelay).Page()
Run the callable associated with this greenlet.
dataset/ETHPy150Open google/textfsm/terminal.py/main--crossover with--dataset/ETHPy150Open tellapart/gevent_request_profiler/tellapart/frontend/gevent_profiler.py/ProfilingGreenlet.run