From de7a795bf886809fdd44edaa9d3d098257acf8e3 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 23 Feb 2015 19:39:36 -0500 Subject: [PATCH] Copy comments on define lines into skeleton --- make-skeleton.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 "."; } } -- 2.50.1