#!/bin/sh
# Pt-storage/src/compat-scripts/rdisk
# 
#  Copyright: ©2011, Güralp Systems Ltd.
#  Author: Laurence Withers <lwithers@guralp.com>
#  License: GPLv3
#
# A very simple compatibility script for implementing the old rdisk command.
# It simply translates "mount" to "--mount" and "format" to "--format". The old
# program's "show" and "power" commands are not supported by this paradigm.
#

ARGS=""
while [ -n "$1" ]
do
	MY_ARG="$1"
	shift

	case "${MY_ARG}" in
	-s | --socket)
		ARGS="${ARGS} --socket $1"
		shift
		;;

	mount | format)
		ARGS="${ARGS} --${MY_ARG}"
		;;
	show | power)
		echo "No longer supported. Use the command 'Pt-storage' instead."
		exit 1
		;;
	*)
		ARGS="${ARGS} ${MY_ARG}"
		;;
	esac
done

exec Pt-storage ${ARGS}
