#!/bin/sh

clear

LD_LIBRARY_PATH=${EM_PYTHON_HOME}/lib
export LD_LIBRARY_PATH

# Check if help is requested
if [[ $* == "-h" ]] || [[ $* == "--h" ]] || [[ $* == *"-help"* ]]; then
  SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
  em bmcpython ${SCRIPT_DIR}/scripts/saas_migration_export.py --help
  exit 0
fi

if [[ $* == *"export_file_location"* ]]; then
  input=$*
else
  read -p "Type a network folder to process the output (empty value for the current folder): " export_file_location
  if [ -z "$export_file_location" ]; then
  	export_file_location='default'
  fi
  input="--export_file_location=$export_file_location $*"
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
em bmcpython ${SCRIPT_DIR}/scripts/saas_migration_export.py $input