From 2c2dcccb7ab3b42240c31b603dc6550ca26fa8ad Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 4 Jan 2022 03:24:11 +0200 Subject: [PATCH 32/32] generate_skips.sh: Validate parameters See osdn #43365 Signed-off-by: Marko Lindqvist --- translations/generate_skips.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/translations/generate_skips.sh b/translations/generate_skips.sh index c2d5bf77fd..ef25d8ef57 100755 --- a/translations/generate_skips.sh +++ b/translations/generate_skips.sh @@ -1,5 +1,5 @@ #!/bin/bash -#/********************************************************************** +#/*********************************************************************** # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,8 +16,8 @@ SRCDIR="$(dirname "$0")" if test "x$1" = "x-h" || test "x$1" = "x--help" ; then - echo "Usage: $(basename $0) [domain=all]" - exit + echo "Usage: $(basename $0) [domain=all]" + exit fi DOMAINLIST_FULL="core nations ruledit" @@ -25,6 +25,20 @@ DOMAINLIST_FULL="core nations ruledit" cd $SRCDIR if test "x$1" != "x" && test "x$1" != "xall" ; then + for domain in $1 + do + domain_found=no + for other_domain in $DOMAINLIST_FULL + do + if test $domain = $other_domain ; then + domain_found=yes + fi + done + if test $domain_found != yes ; then + echo "Unknown domain \"$domain\" given!" >&2 + exit 1 + fi + done DOMAINLIST="$1" else DOMAINLIST="$DOMAINLIST_FULL" -- 2.34.1