configdata.pm: Allow extra arguments when --query is given.
authorRichard Levitte <levitte@openssl.org>
Fri, 28 May 2021 05:51:05 +0000 (07:51 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 29 May 2021 09:02:37 +0000 (11:02 +0200)
That allows operations like this:

    ./configdata.pm --query 'get_sources(@ARGV)' file1 file2 file3

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15514)

configdata.pm.in

index 57ad440fa41be046231732e202e66cc7bfef996a..14da489cd38fd92f59e41e827abbd818d05ae08a 100644 (file)
@@ -178,7 +178,10 @@ _____
                'man'                    => \$man)
         or die "Errors in command line arguments\n";
 
-    if (scalar @ARGV > 0) {
+    # We allow extra arguments with --query.  That allows constructs like
+    # this:
+    # ./configdata.pm --query 'get_sources(@ARGV)' file1 file2 file3
+    if (!$query && scalar @ARGV > 0) {
         print STDERR <<"_____";
 Unrecognised arguments.
 For more information, do '$0 --help'