code: def _main():
      ''' Main function gets input parameters, sets up listener and starts
          the listener
      '''
      global listener
  
      if len(_sys.argv) < 2 or _sys.argv[1] == '--help':
          print("Usage: %s host http_port [https_port certfile keyfile]" % \
                _sys.argv[0])
          _sys.exit(2)
  
      logging.basicConfig(stream=_sys.stderr, level=logging.INFO,
                          format='%(asctime)s %(levelname)s: %(message)s')
  
      host = _get_argv(1)
      http_port = _get_argv(2)
      https_port = _get_argv(3)
      certfile = _get_argv(4)
      keyfile = _get_argv(5)
  
      listener = pywbem.WBEMListener(host=host,
                                     http_port=http_port,
                                     https_port=https_port,
                                     certfile=certfile,
                                     keyfile=keyfile)
  
      listener.add_callback(_process_indication)
      listener.start()
  
  
      banner =  % (host, http_port, https_port)
  
      # Determine file path of history file
      home_dir = '.'
      if 'HOME' in _os.environ:
          home_dir = _os.environ['HOME'] # Linux
      elif 'HOMEPATH' in _os.environ:
          home_dir = _os.environ['HOMEPATH'] # Windows
      histfile = '%s/.listen_history' % home_dir
  
      # Read previous command line history
      if _HAVE_READLINE:
          NotFoundError = getattr(__builtins__, 'FileNotFoundError', IOError)
          try:
              _readline.read_history_file(histfile)
          except NotFoundError as exc:
              if exc.errno != _errno.ENOENT:
                  raise
  
      # Interact
      i = _code.InteractiveConsole(globals())
      i.interact(banner)
  
      # Save command line history
      if _HAVE_READLINE:
          _readline.write_history_file(histfile)
  
      return 0
docs: Main function gets input parameters, sets up listener and starts
          the listener