]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
change '-r file' to '-o file'
authorAlan T. DeKok <aland@freeradius.org>
Fri, 3 Apr 2026 16:53:36 +0000 (12:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 3 Apr 2026 17:47:33 +0000 (13:47 -0400)
the default is to assume that '-r file' means "read file".
Instead, it means "destroy that file", which is unfriendly.

src/bin/unit_test_attribute.c
src/tests/dict/all.mk
src/tests/unit/all.mk

index 32736c08fdd04c7976d0c43a22e43c9929e3a149..a87c299f24721e3ee1a029480e91d8084f3027d2 100644 (file)
@@ -4050,7 +4050,7 @@ static void usage(char const *name)
        INFO("  -h                 Print help text.");
        INFO("  -M                 Show talloc memory report.");
        INFO("  -p                 Allow xlat_purify");
-       INFO("  -r <receipt_file>  Create the <receipt_file> as a 'success' exit.");
+       INFO("  -o <receipt_file>  Create the <receipt_file> as a 'success' exit.");
        INFO("  -w <output_file>   Write 'corrected' output to <output_file>.");
        INFO("Where <filename> is a file containing one or more commands and '-' indicates commands should be read from stdin.");
        INFO("Ranges of <lines> may be specified in the format <start>[-[<end>]][,]");
@@ -4377,7 +4377,7 @@ int main(int argc, char *argv[])
        default_log.fd = STDOUT_FILENO;
        default_log.print_level = false;
 
-       while ((c = getopt(argc, argv, "cd:D:F:fxMhpr:S:w:")) != -1) switch (c) {
+       while ((c = getopt(argc, argv, "cd:D:F:fxMhpo:S:w:")) != -1) switch (c) {
                case 'c':
                        do_commands = true;
                        break;
@@ -4407,7 +4407,7 @@ int main(int argc, char *argv[])
                        talloc_enable_leak_report();
                        break;
 
-               case 'r':
+               case 'o':
                        p = strrchr(optarg, '/');
                        if (!p || p[1]) {
                                receipt_file = optarg;
index 9213663743bdd44d69f6f22f148a3975f0a0df9b..6fcee8b5524d81e9d3581cd0b086ddfe9562aa40 100644 (file)
@@ -20,11 +20,11 @@ $(OUTPUT)/%.dict: $(DIR)/%.dict $(TEST_BIN_DIR)/unit_test_attribute
        @cp $< $@
        @cp src/tests/dict/base.txt $@.txt
        @echo "load-dictionary $(top_srcdir)/$<" >> $@.txt
-       ${Q}if ! $(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -r "$@" "$@.txt" > "$@.log" 2>&1 || ! test -f "$@"; then \
+       ${Q}if ! $(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -o "$@" "$@.txt" > "$@.log" 2>&1 || ! test -f "$@"; then \
                rm -f $@; \
                cat "$@.log"; \
                echo "# $@.log"; \
-               echo "$(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -r "$@" -xx '$@.txt'"; \
+               echo "$(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -o "$@" -xx '$@.txt'"; \
                exit 1; \
        fi
 
@@ -38,11 +38,11 @@ $(OUTPUT)/%.dict: $(DIR)/%.dict $(TEST_BIN_DIR)/unit_test_attribute
        @cp $< $@
        @cp src/tests/dict/base.txt $@.txt
        @echo "load-dictionary $(top_srcdir)/$<" >> $@.txt
-       ${Q}if ! $(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -r "$@" "$@.txt" > "$@.log" 2>&1 || ! test -f "$@"; then \
+       ${Q}if ! $(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -o "$@" "$@.txt" > "$@.log" 2>&1 || ! test -f "$@"; then \
                rm -f $@; \
                cat "$@.log"; \
                echo "# $@.log"; \
-               echo "$(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -r "$@" -xx '$@.txt'"; \
+               echo "$(TEST_BIN)/unit_test_attribute -D $(top_srcdir)/share/dictionary -o "$@" -xx '$@.txt'"; \
                exit 1; \
        fi
 
index fbb8dc3ef3e7a080a990e4bf7692155394094677..a589a0bda25ad3aaf20d94d01735036854120e21 100644 (file)
@@ -89,8 +89,8 @@ $(filter $(BUILD_DIR)/tests/unit/purify/%,$(FILES.$(TEST))): PURIFY=-p
 #
 $(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_attribute
        $(eval DIR:=${top_srcdir}/src/tests/unit)
-       $(eval export UNIT_TEST_ATTRIBUTE:=TZ=GMT $(TEST_BIN_NO_TIMEOUT)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r \"$@\" $<)
-       ${Q}$(TEST_BIN)/unit_test_attribute $(PURIFY) $(REWRITE_FLAGS) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r "$@" $<
+       $(eval export UNIT_TEST_ATTRIBUTE:=TZ=GMT $(TEST_BIN_NO_TIMEOUT)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -o \"$@\" $<)
+       ${Q}$(TEST_BIN)/unit_test_attribute $(PURIFY) $(REWRITE_FLAGS) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -o "$@" $<
 
 $(TEST):
        @touch $(BUILD_DIR)/tests/$@