Make --lang a required script argument

This commit is contained in:
Jeroen Ketema
2022-02-16 10:18:55 +01:00
parent 1209bbd9b4
commit f558ac5b07

View File

@@ -15,22 +15,21 @@ usage()
cat >&2 <<EOF
${app_name}: $@
${app_name}: Generate skeleton upgrade script.
Usage: ${app_name} [--prev_hash <COMMITISH>] [--lang <LANG>]"
Usage: ${app_name} --lang <LANG> [--prev_hash <COMMITISH>]"
--lang <LANG>
Language to update the schema for.
--prev-hash <COMMITISH>
Hash/branch to use to get SHA1 for previous DB scheme.
Default: origin/main
--lang <LANG>
Language to update the schema for.
Must be run within the git repo needing an update.
EOF
exit "${exit_code}"
}
prev_hash="origin/main"
lang="cpp"
while [ $# -gt 0 ]; do
case "$1" in
@@ -72,6 +71,10 @@ if [ $# -gt 0 ]; then
usage 2 "Unrecognised operand: $1"
fi
if [ -z ${lang+x} ]; then
usage 2 "No language specified"
fi
top_level="$(git rev-parse --show-superproject-working-tree)"
if [ "x${top_level}" = "x" ]; then