From: Nathaniel Wesley Filardo Date: Tue, 24 Feb 2015 00:39:36 +0000 (-0500) Subject: Copy comments on define lines into skeleton X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=de7a795bf886809fdd44edaa9d3d098257acf8e3;p=grade Copy comments on define lines into skeleton --- diff --git a/make-skeleton.pl b/make-skeleton.pl index 1a01247..cbb78d1 100755 --- a/make-skeleton.pl +++ b/make-skeleton.pl @@ -37,9 +37,13 @@ while(my $line = ) { } # :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 = ) { chomp $cline; last if $cline eq "."; } }