]> hydra-www.ietfng.org Git - grade/commitdiff
Copy comments on define lines into skeleton
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 24 Feb 2015 00:39:36 +0000 (19:39 -0500)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 24 Feb 2015 00:39:36 +0000 (19:39 -0500)
make-skeleton.pl

index 1a0124736d391b358d5dcefc2ec94d2f8adb9212..cbb78d1922cf6635f65894378e0915e48ca3b583 100755 (executable)
@@ -37,9 +37,13 @@ while(my $line = <STDIN>) {
   }
 
   # :define directive?
-  elsif ($line =~ /^(:\S+)\s+/) {
+  elsif ($line =~ /^(:\S+)\s+[^#]*(#.*)?$/) {
     die "Directive not within section" if not defined $section and not $skipsec;
-    print "#$1\n" if not $skipsec;
+    if (defined $2) {
+        print "#$1 $2\n" if not $skipsec;
+    } else {
+        print "#$1\n" if not $skipsec;
+    }
     while (my $cline = <STDIN>) { chomp $cline; last if $cline eq "."; }
   }