Revision 7a91596e setup.sh
setup.sh | ||
---|---|---|
111 | 111 |
eval set -- "$arguments" |
112 | 112 |
|
113 | 113 |
# evaluate arguments |
114 |
local numchars=1
|
|
114 |
local numchars=0
|
|
115 | 115 |
local options="" |
116 | 116 |
local outvar="" |
117 | 117 |
while [ true ]; do |
... | ... | |
137 | 137 |
# read user input |
138 | 138 |
local _userinput="" |
139 | 139 |
while [ -z $_userinput ] || ( [ $numchars == 1 ] && [ ! -z "$options" ] && [[ ! $_userinput =~ ^["$options"]$ ]] ); do |
140 |
read -p "your selection: " -n $numchars -e _userinput |
|
140 |
if [ $numchars == 0 ]; then |
|
141 |
read -p "your selection: " -e _userinput |
|
142 |
else |
|
143 |
read -p "your selection: " -n $numchars -e _userinput |
|
144 |
fi |
|
141 | 145 |
if [ -z $_userinput ] || ( [ $numchars == 1 ] && [ ! -z "$options" ] && [[ ! $_userinput =~ ^["$options"]$ ]] ); then |
142 | 146 |
printWarning "[$_userinput] is no valid action\n" |
143 | 147 |
fi |
... | ... | |
456 | 460 |
if [[ $@ == *"--help"* || $@ == *"-h"* ]]; then |
457 | 461 |
printHelp |
458 | 462 |
printf "\n" |
459 |
exitScript
|
|
463 |
quitScript
|
|
460 | 464 |
fi |
461 | 465 |
|
462 | 466 |
# handle command line arguments |
Also available in: Unified diff