#!/usr/bin/env perl

use strict;
use warnings;

our $VERSION = '1.119';


use autodie qw< :all >; # Just to be sure that we're using the correct version of Fatal.
use Fatal;

use List::MoreUtils qw< uniq >;


if (not @ARGV) {
    push @ARGV, ':default';
}

foreach my $tag (@ARGV) {
    # Uses a private sub, but this is what Paul Fenwick suggested.
    my $functions = Fatal->_expand_tag($tag);

    print $tag, q< > x 3;

    foreach my $function ( uniq( sort @{$functions} ) ) {
        (my $stripped = $function) =~ s< \A CORE:: ><>xms;

        print q< >, $stripped;
    }

    print "\n";
}

__END__

#-----------------------------------------------------------------------------

=pod

=head1 NAME

dump-autodie-tag-contents - List the perl functions covered by a given L<autodie> tag.

=head1 SYNOPSIS

    dump-autodie-tag-contents       # Dump the :default tag.
    dump-autodie-tag-contents :io   # Dump all the I/O builtins autodie can
                                    # deal with.

=head1 DESCRIPTION

This is a simple tool for helping to maintain the InputOutput::RequireChecked*
policies.

It lists all the perl builtins that a given L<autotag> tag covers.  If none is
specified, the ":default" tag is used.

=head1 AUTHOR

Elliot Shank C<< <perl@galumph.com> >>

=head1 COPYRIGHT

Copyright (c) 2008-2011 Elliot Shank.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  The full text of this license
can be found in the LICENSE file included with this module.

=cut

##############################################################################
# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 78
#   indent-tabs-mode: nil
#   c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :