#!/bin/sh

[ ! "$STTA" ] && echo "STTA no set "  && exit 2 
. $STTA/envprofile

show_help  $DEVTOOLS/help

if [ $1 ] ; then
   opc=""
   case $1 in
        -x|x) opc="-x" ; shift ;;
   esac
   cmd=$1
   shift 
else
   cd $DEVTOOLS 2>$dn
   echo "sttadev [ cmd  args] [ -c|-b  backup | -s save | -r remove/cleanup ]"
   echo "tools list ($DEVTOOLS): "
   lista=`ls 2>$dn` 
   for file in ` echo $lista ` 
   do 
       [ ! -d $file ] && [ -x $file ] && echo  "$file"
   done
   exit 1
fi 
case $cmd in
     -c|-C|-b|-B)  cmd=$CP_command ;;
     -s|-S)  cmd=$SAVE_command ;;
     -r|-R)  cmd=$CLEANUP_command ;;
esac
if [ -x $DEVTOOLS/$cmd ] 
then
   [ "$opc" ] && sh $opc $DEVTOOLS/$cmd $@  && exit
   exec $DEVTOOLS/$cmd $@ 
else
   echo "No puedo ejecutar $cmd $@"
fi
