| git.druid.rocks | index | druid520 | mp | plugins/ | hello.pl |
plugins/hello.pl
#!/usr/bin/env perl
use v5.16;
use strict;
use warnings FATAL => 'all';
use FindBin;
use lib "$FindBin::Bin";
use mplib::config qw($CFG);
use mplib::util qw(ok);
use mplib::resolve qw(init);
# a minimal, runnable example plugin -- see docs/reference/extensions.btft. FindBin::Bin
# resolves to the directory the installed mp.hello SYMLINK lives in (the
# top-level build output, same place mp/mp.<cmd>/mplib all live), not to
# plugins/ itself -- so "use lib" here is identical to any core command's,
# regardless of which source directory a plugin's own .pl file lives in.
my $flags = mplib::config::parse_flags(\@ARGV);
mplib::config::load($flags);
init();
ok("hello from a plugin (WD=$CFG->{WD})");