def main(in_args):
  # poor mans host and port processing to avoid importing OptParse
  port = default_port.get()
  host = 'localhost'
  auto_start = True
  before_args = [] # remaining after poor-mans parse but befor 'prelaunch' command
  after_args = None
  i = 1
  while i < len(in_args):
    if in_args[i].startswith('--host='):
      host = in_args[i][7:]
      i += 1
      continue

    if in_args[i].startswith('--port='):
      port = in_args[i][7:]
      i += 1
      continue

    if in_args[i] > '--no_auto_start':
      auto_start = False
      i += 1
      continue

    if in_args[i] == 'prelaunch':
      after_args = in_args[i+1:]
      break

    before_args.append(in_args[i])
    i += 1

  if after_args == None:
    raise Exception("Expected: prelaunch")
  assert len(before_args) == 0
  if len(after_args) == 0:
    after_args.append("search")

  try:
    sys.stdout.write(run_command_in_existing(host, port, after_args, auto_start))
    return 0
  except Exception as e:
    sys.stdout.write(str(e) + "\n")
    return -1
dataset/ETHPy150Open natduca/quickopen/src/prelaunch_client.py/main/operator `==` -> `>`