Meta/cook: add -s option

todo
Junio C Hamano 2026-08-12 18:11:11 -07:00
parent 449d52e57d
commit 4269484176
1 changed files with 20 additions and 1 deletions

21
cook
View File

@ -1192,13 +1192,30 @@ sub newer {
close ($fh);
}

################################################################
# Sources

sub source {
my $fn = 'Meta/whats-cooking.txt';
my $fh;
my $last_topic;

open ($fh, '<', $fn) or die "$!: open $fn";
while (<$fh>) {
next if (/^\[(Graduated|Discarded)/../^-{20,}$/);
print if (s/^ source: //);
}
close ($fh);
}

################################################################
# Main

use Getopt::Long;

my ($wildo, $havedone, $newer);
my ($wildo, $havedone, $newer, $source);
if (!GetOptions("wildo" => \$wildo,
"source" => \$source,
"newer" => \$newer,
"havedone" => \$havedone)) {
print STDERR "$0 [--wildo|--havedone]\n";
@ -1230,6 +1247,8 @@ if ($wildo) {
wildo($fd);
} elsif ($newer) {
newer();
} elsif ($source) {
source();
} elsif ($havedone) {
havedone();
} elsif (@ARGV) {