]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
verify-synopsis.pl: work with .md files
authorDaniel Stenberg <daniel@haxx.se>
Thu, 27 Jun 2024 09:23:13 +0000 (11:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 Jun 2024 10:45:06 +0000 (12:45 +0200)
Ref: #14037
Closes #14038

.github/scripts/verify-synopsis.pl

index 9d32185035e63d3decd64d643fa31a874f98e180..aa269179461ddd4c707e9be2a1f8c157aa7d432f 100755 (executable)
@@ -46,17 +46,17 @@ sub extract {
     open(O, ">$cfile");
     while(<F>) {
         $iline++;
-        if(/^.SH SYNOPSIS/) {
+        if(/^# SYNOPSIS/) {
             $syn = 1
         }
         elsif($syn == 1) {
-            if(/^.nf/) {
+            if(/^\~\~\~/) {
                 $syn++;
                 print O "#line $iline \"$f\"\n";
             }
         }
         elsif($syn == 2) {
-            if(/^.fi/) {
+            if(/^\~\~\~/) {
                 last;
             }
             # turn the vararg argument into vararg
@@ -68,13 +68,17 @@ sub extract {
     close(F);
     close(O);
 
+    if($syn < 2) {
+        print STDERR "Found no synopsis in $f\n";
+        return 1;
+    }
+
     return 0;
 }
 
 my $error;
 for my $m (@files) {
-    print "Verify $m\n";
-    extract($m);
+    $error |= extract($m);
     $error |= testcompile($m);
 }
 exit $error;