package Getopt::Long::Descriptive::Patch::DumpAndExit;

our $DATE = '2016-10-27'; # DATE
our $VERSION = '0.001'; # VERSION

use 5.010001;
use strict;
no warnings;

use Data::Dmp;
use Module::Patch 0.19 qw();
use base qw(Module::Patch);

our %config;

sub _dump {
    print "# BEGIN DUMP $config{-tag}\n";
    local $Data::Dmp::OPT_DEPARSE = 0;
    say dmp($_[0]);
    print "# END DUMP $config{-tag}\n";

sub _build_describe_options {
    sub {
        $config{-exit_method} eq 'exit' ? exit(0) : die;

sub patch_data {
    return {
        v => 3,
        patches => [
                action      => 'replace',
                sub_name    => '_build_describe_options',
                code        => \&_build_describe_options,
        config => {
            -tag => {
                schema  => 'str*',
                default => 'TAG',
            -exit_method => {
                schema  => 'str*',
                default => 'exit',

# ABSTRACT: Patch Getopt::Long::Descriptive to dump option spec and exit



=encoding UTF-8

=head1 NAME

Getopt::Long::Descriptive::Patch::DumpAndExit - Patch Getopt::Long::Descriptive to dump option spec and exit

=head1 VERSION

This document describes version 0.001 of Getopt::Long::Descriptive::Patch::DumpAndExit (from Perl distribution Getopt-Long-Descriptive-Dump), released on 2016-10-27.


This patch can be used to extract Getopt::Long::Descriptive options
specification from a script by running the script but exiting early after
getting the specification.

=for Pod::Coverage ^(patch_data)$


Please visit the project's homepage at L<>.

=head1 SOURCE

Source repository is at L<>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired

=head1 AUTHOR

perlancar <>


This software is copyright (c) 2016 by

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.