App-ModuleBuildTiny

 view release on metacpan or  search on metacpan

script/mbtiny  view on Meta::CPAN


our $VERSION = '0.051';

print_help() if ($ARGV[0] // 'help') eq 'help';

modulebuildtiny(@ARGV);

sub print_help {
	my $program = basename($0);
	print "Usage: $program <command> [arguments ...]\n\nAvailable commands:\n\n";
	App::ModuleBuildTiny::Help->filter(__FILE__);
	print "\n";
	exit !@ARGV;
}

package App::ModuleBuildTiny::Help;

use parent qw(Pod::Simple::Methody);

sub start_head1 {
	my ($self, $attrs) = @_;
	$self->{_mbth_head1_content} = '';
}

sub end_head1   {
	my ($self) = @_;

	$self->{_mbth_in_subcommands} = delete($self->{_mbth_head1_content}) eq 'SUBCOMMANDS';
}

sub start_head2 {
	my ($self, $attrs) = @_;

	return unless $self->{_mbth_in_subcommands};
	$self->{_mbth_subcommand_name} = '';
}

sub end_head2 {
	my ($self) = @_;

	if (my $cmd = delete $self->{_mbth_subcommand_name}) {
		$self->output_fh->printf("    %-10s - ", $1) if $cmd =~ /(^\w+)/;
		$self->{_mbth_print_desc} = 1;
	}
}

sub handle_text {
	my ($self, $text) = @_;

	if (defined $self->{_mbth_head1_content}) {
		$self->{_mbth_head1_content} .= $text;
		return;
	}

	if (defined $self->{_mbth_subcommand_name}) {
		$self->{_mbth_subcommand_name} .= $text;
		return;
	}

	if (delete $self->{_mbth_print_desc}) {
		$self->output_fh->say($1) if $text =~ /^([^.(]+)/;
	}
}

__END__

=head1 NAME

mbtiny - A standalone authoring script for Module::Build::Tiny

=head1 SYNOPSIS

 mbtiny listdeps | cpanm
 mbtiny test --release
 mytiny regenerate
 mbtiny upload

=head1 DESCRIPTION

C<mbtiny> is a tool to help assemble your CPAN distributions. It's a minimalist tool that tries to come with as few surprises as possible, and thus provide a gentle learning curve for its users.

=head1 SUBCOMMANDS

=head2 regenerate [--bump] [--version=<version] [--verbose] [--dry-run] [--scan] <files>...

Regenerate the specified files. If no files are given, defaults to all six files it can regenerate. You usually want to do this when bumping the version of a module. Takes the following options:

=over 4

=item * bump

Bump the version of the distribution before regenerating. The default for this when regenerating all files can be set in the configuration.

=item * version = <new-version>

Set the version of the distribution before regenerating.

=item * scan

Scan for dependencies to include in the metafiles. The default for this can be set in the configuration.

=item * trial

Make the new version a trial version.

=item * commit

Create a git commit for the version bump. The default for this when regenerating all files can be set in the configuration.

=item * verbose

This will make regeneration more verbose.

=item * dry-run

This will cause it to not write anything to disk, this is only ever useful when combined with the verbose option.

=back

The following files can be generated:



( run in 0.407 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )