]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mdlinkcheck: add --dry-run to only show all found URLs
authorDaniel Stenberg <daniel@haxx.se>
Wed, 10 Dec 2025 07:45:34 +0000 (08:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 10 Dec 2025 09:51:10 +0000 (10:51 +0100)
- remove the debug tracing leftovers from d9d2e339ced3fa02 that made exit
  unconditonally

Closes #19914

scripts/mdlinkcheck

index f50d77527a29666169870504f4e9b0e580740e41..bd54d96fe2ea2a673eb624650625467da178b710 100755 (executable)
@@ -84,6 +84,12 @@ my %whitelist = (
 my %url;
 my %flink;
 
+my $dry;
+if(defined $ARGV[0] && $ARGV[0] eq "--dry-run") {
+    $dry = 1;
+    shift @ARGV;
+}
+
 # list all files to scan for links
 my @files=`git ls-files docs include lib scripts src`;
 
@@ -207,10 +213,12 @@ for my $u (sort keys %whitelist) {
     }
 }
 
-for my $u (sort keys %url) {
-    print "$u\n";
+if($dry) {
+    for my $u (sort keys %url) {
+        print "$u\n";
+    }
+    exit;
 }
-exit;
 
 my $error;
 my @errlist;