Help language development. Donate to The Perl Foundation

App::Mi6 cpan:SKAJI last updated on 2022-03-13

bin/mi6
#!/usr/bin/env raku
use App::Mi6;

my %*SUB-MAIN-OPTS = :named-anywhere;
my $app = App::Mi6.new;

multi MAIN("version") {
    say $app.dist.meta<version>;
}
multi MAIN("new", $module, :fez(:$zef)) {
    $app.cmd("new", $module, :$zef);
}
multi MAIN("build") {
    $app.cmd("build");
}
multi MAIN("test", *@file, Bool :v(:$verbose), Int :j(:$jobs)) {
    $app.cmd("test", @file, :$verbose, :$jobs);
}
multi MAIN("release", Bool :k(:$keep), Str :$next-version, Bool :$yes) {
    $app.cmd("release", :$keep, :$next-version, :$yes);
}
multi MAIN("dist", Bool :$no-top-directory) {
    $app.cmd("dist");
}
multi MAIN("upload") {
    die "`mi6 upload` is removed, please execute `mi6 release` instead.\n";
}
multi MAIN("help") {
    USAGE();
}
multi MAIN(:h(:$help)!) {
    USAGE();
}
sub USAGE {
    require Pod::To::Text;
    ::("Pod::To::Text").render($=pod).say;
    exit 1;
}

=begin pod

=head1 USAGE

  $ mi6 new Foo::Bar # create Foo-Bar distribution
  $ mi6 build        # build the distribution, and re-generate README.md/META6.json
  $ mi6 test         # run tests
  $ mi6 release      # release your distribution tarball to CPAN
  $ mi6 version      # show mi6 version
  $ mi6 help         # show this help

  Details:

  $ mi6 new Foo::Bar
    Create Foo-Bar distribution

    Options:
      --zef, --fez  create distribution for Zef ecosystem

  $ mi6 build
    Build the distribution, and re-generate README.md/META6.json.
    Here 'build' means if Build.pm is present, then execute it, otherwise nothing happens.

    Options:
     (none)

  $ mi6 test [test files/directory]
    Run tests

    Options:
     -v, --verbose   print all test lines
     -j, --jobs=N    run N test jobs in parallel

  $ mi6 release
    Create tarball for your distribution, and release it to CPAN.
    You should prepare ~/.pause file before releasing.

    Options:
     -k, --keep          do not delete local tarball after releasing it to CPAN
         --next-version  set next release version manually
         --yes           do not raise prompt; accept the default behavior

  $ mi6 version
    Show mi6 version

    Options:
     (none)

  $ mi6 help, mi6 --help
    Show this help

    Options:
     -h, --help   show this help

=end pod