This commit is contained in:
2021-01-14 20:24:58 +01:00
parent a523678b32
commit 311d768262
+4 -4
View File
@@ -4,7 +4,7 @@
readonly USAGE="
USAGE:
$(basename "$0") [BUILD or SCRAPe] [PATH] [SYSTEM]"
$(basename "$0") [BUILD or SCRAP] [PATH] [SYSTEM]"
function help_message() {
echo "$USAGE"
@@ -17,14 +17,14 @@ function help_message() {
SYSTEMS="apple2 arcade atari2600 atari7800 atarilynx coleco gamegear gb gba gbc mastersystem megadrive msx n64 nes ngpc pcengine sega32x sg1000 snes vectrex virtualboy wonderswan wonderswancolor"
# check if there is any parameter
# check if there are all the parameters
if [ "$#" -ne 3 ]; then
help_message
exit 0
fi
# check if the parameter is valid
if ! echo "$SYSTEMS" | grep -w "$1" >/dev/null; then
# check if the systems parameter is valid
if ! echo "$SYSTEMS" | grep -w "$3" >/dev/null; then
printf "%s\n" "You must enter a valid SYSTEM name."
help_message
exit 0