#!/bin/bash

INPUT=/tmp/menu-env.sh.$$

while true
do

### display main menu ###
dialog --clear  --help-button --backtitle "Change Environment for RDAA" \
--title "[ Environment - M E N U ]" \
--menu "You can use the UP/DOWN arrow keys, the first \n\
letter of the choice as a hot key, or the \n\
number keys 1-9 to choose an option.\n\
Choose the TASK" 19 60 9 \
Dev "Development Environment" \
Test "Test Environment" \
Prod "Production Environment" \
Exit "Exit" 2>"${INPUT}"

menuitem=$(<"${INPUT}")

case $menuitem in
	Dev) rdaa-env dev;;
	Test) rdaa-env test;;
	Prod) rdaa-env prod;;
	Exit) echo "Back"; break;;
esac

done

[ -f $INPUT ] && rm $INPUT