From 630af0d36913208b0857ff2dccb202bcdfcd6bde Mon Sep 17 00:00:00 2001 From: Bertrand Gouny Date: Tue, 13 Oct 2026 22:04:51 +0200 Subject: [PATCH] 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 --- .../assets/openldap-ctl/command/schema2ldif.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/openldap/assets/openldap-ctl/command/schema2ldif.sh b/services/openldap/assets/openldap-ctl/command/schema2ldif.sh index 7450a18..c1f07eb 100755 --- a/services/openldap/assets/openldap-ctl/command/schema2ldif.sh +++ b/services/openldap/assets/openldap-ctl/command/schema2ldif.sh @@ -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