feat(ctl): print usage when schema2ldif has no arguments

Also fix a typo in the conversion error message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bertrand Gouny
2026-10-13 22:06:15 +02:00
co-authored by Claude Opus 5.5
parent e60f2c32d1
commit 630af0d369
@@ -6,6 +6,15 @@ set -euo pipefail
# print commands and their arguments as they are executed
container log level eq trace && set -x
usage() {
echo "Usage: openldap-ctl schema2ldif \"schema-files\" [\"dependencies\"]"
}
if [ "$#" -lt 1 ]; then
usage
container log fatal "Missing schema files"
fi
SCHEMAS=$1
DEPENDENCIES=${2:-${OPENLDAP_CTL_SCHEMA2LDIF_DEPENDENCIES}}
@@ -36,7 +45,7 @@ for schema in ${SCHEMAS} ; do
done
if ! slaptest -f "${TMP_FILE}" -F "${TMP_DIR}" > /dev/null ; then
container log fatal "Failed do convert ${SCHEMAS} to ldif"
container log fatal "Failed to convert ${SCHEMAS} to ldif"
fi
for schema in ${SCHEMAS} ; do