#! /bin/bash

mydir=$(dirname $0)
cd $mydir/cleaner

export PYTHONPATH=../pyVpx:../third-party:..

export SDDC_EDGE_REMOVER_USAGE_NAME=$(basename $0)

# preserve quoting for any args which contain spaces, this way the
# spaces are retained when invoking python.
args=()

for arg in "$@"; do
  if [[ "$arg" =~ " " ]]; then
    qval="'$arg'"
  else
    qval="$arg"
  fi
  qval=$(echo $qval | sed 's/[$`&()|;<>]/\\&/g')
  args+=("$qval")
done

eval python3 ./edge_cluster_cleaner.py "${args[@]}"
