Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#262247: zsh: Improved make completion
- X-seq: zsh-workers 20223
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#262247: zsh: Improved make completion
- Date: Fri, 30 Jul 2004 11:30:54 -0400
- Cc: Hugo Haas <hugo@xxxxxxxxx>, 262247-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <20040730101751.GA11905@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20040730101751.GA11905@xxxxxxxxx>
> Attached is a Perl script that can be used as a replacement of the
> Perl script appearing in the make completion code (_make) to follow
> include statements in Makefiles.
You mean it should replace the expression
'@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/ and
print join(" ", @matches);
if (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
/^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) {
print "fetch fetch-list extract patch configure build install reinstall dein
stall package describe checkpatch checksum makesum\n";
}
'
in _make?
Maybe the perl and awk bits should be replaced by some native Z-Shell parsing.
sub match() {
my ($fn) = @_;
@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/ and
print join(" ", @matches);
if (/^include\s+(\S+)/) {
my $i = $1;;
if ($fn =~ m|/|) {
$fn =~ s|/[^/]+$|/$i|;
} else {
$fn = $i;
}
&parse($fn);
}
elsif (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
/^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) {
print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum\n";
}
}
sub parse() {
my ($fn) = @_;
my $f;
open($f, $fn) || return;
while (<$f>) {
&match($fn);
}
close($f);
}
&parse($ARGV[0]);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author