Skip to content
Snippets Groups Projects
Commit 28cfbc84 authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

indent user_menu.sh

parent d55210a8
No related branches found
No related tags found
1 merge request!225Update scripts
...@@ -3,60 +3,60 @@ BASE= ...@@ -3,60 +3,60 @@ BASE=
TYPE= TYPE=
while getopts ":t:n:b:" OPTION while getopts ":t:n:b:" OPTION
do do
case ${OPTION} in case ${OPTION} in
t) t)
TYPE=${OPTARG} TYPE=${OPTARG}
;; ;;
n) n)
NAME=${OPTARG} NAME=${OPTARG}
;; ;;
b) b)
BASE=${OPTARG} BASE=${OPTARG}
;; ;;
*) *)
showHelp showHelp
exit exit
;; ;;
esac esac
done done
if [ -z "$TYPE" ] && [ -z "$NAME" ] && [ -z "$BASE" ] if [ -z "$TYPE" ] && [ -z "$NAME" ] && [ -z "$BASE" ]
then then
showHelp showHelp
exit exit
fi fi
if [ -z "$TYPE" ] ; if [ -z "$TYPE" ] ;
then then
echo "" echo ""
echo "${RED} [ERROR]: Missing TYPE value (-t).${NC}" echo "${RED} [ERROR]: Missing TYPE value (-t).${NC}"
echo "" echo ""
showHelp showHelp
exit exit
fi fi
if [ -z "$NAME" ] ; if [ -z "$NAME" ] ;
then then
echo "" echo ""
echo "${RED} [ERROR]: Missing NAME value (-n).${NC}" echo "${RED} [ERROR]: Missing NAME value (-n).${NC}"
echo "" echo ""
showHelp showHelp
exit exit
fi fi
if [ -z "$BASE" ] ; if [ -z "$BASE" ] ;
then then
echo "" echo ""
echo "${RED} [ERROR]: Missing BASE value (-b).${NC}" echo "${RED} [ERROR]: Missing BASE value (-b).${NC}"
echo "" echo ""
showHelp showHelp
exit exit
fi fi
if ! [ "$TYPE" == "capture" ] && ! [ "$TYPE" == "constraint" ] && ! [ "$TYPE" == "feature" ] && ! [ "$TYPE" == "landmark" ] && ! [ "$TYPE" == "processor" ] && ! [ "$TYPE" == "sensor" ] if ! [ "$TYPE" == "capture" ] && ! [ "$TYPE" == "constraint" ] && ! [ "$TYPE" == "feature" ] && ! [ "$TYPE" == "landmark" ] && ! [ "$TYPE" == "processor" ] && ! [ "$TYPE" == "sensor" ]
then then
echo "" echo ""
echo "${RED} --> Incorrect type \"$TYPE\". Please check the following instructions: ${NC}" echo "${RED} --> Incorrect type \"$TYPE\". Please check the following instructions: ${NC}"
echo "" echo ""
showHelp showHelp
exit 1 exit 1
fi fi
NAME=$(LowerCase $NAME) NAME=$(LowerCase $NAME)
...@@ -81,12 +81,12 @@ BASECLASSNAME=$TYPE_CAP1$(echo "$(echo "$BASECLASSNAME" | sed 's/.*/\u&/')") ...@@ -81,12 +81,12 @@ BASECLASSNAME=$TYPE_CAP1$(echo "$(echo "$BASECLASSNAME" | sed 's/.*/\u&/')")
if ! [[ $NAME =~ $TYPE ]] ; if ! [[ $NAME =~ $TYPE ]] ;
then then
if [[ $BASE =~ .*base*. ]] ; if [[ $BASE =~ .*base*. ]] ;
then then
NAME="$TYPE"_"$NAME"; NAME="$TYPE"_"$NAME";
else else
NAME="$TYPE"_"$BASE"_"$NAME"; NAME="$TYPE"_"$BASE"_"$NAME";
fi fi
fi fi
if ! [[ $BASE =~ $TYPE ]] ; if ! [[ $BASE =~ $TYPE ]] ;
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment