mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-27 04:38:26 +02:00
27 lines
387 B
Plaintext
27 lines
387 B
Plaintext
|
#!/usr/bin/perl
|
||
|
|
||
|
|
||
|
sub usage
|
||
|
{
|
||
|
print STDERR "usage: $0 command [arg ...]\n";
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
|
||
|
&usage unless @ARGV;
|
||
|
|
||
|
($d = $0) =~ s|/[^/]*$||;
|
||
|
if ($d eq "") {
|
||
|
$p = "/";
|
||
|
} elsif ($d =~ /^\//) {
|
||
|
$p = "$d";
|
||
|
} else {
|
||
|
chomp($cwd = `pwd`);
|
||
|
$p = "$cwd/$d";
|
||
|
}
|
||
|
|
||
|
$cmd = shift @ARGV;
|
||
|
$cmd = "$p/$cmd" unless $cmd =~ m|/|;
|
||
|
exec("perl", "-I", $p, $cmd, @ARGV);
|
||
|
die "exec perl: $!";
|