#!/usr/bin/env perl
use strict;
use warnings;

# PODNAME: dest
# ABSTRACT: Deployment State Manager
our $VERSION = '1.23'; # VERSION

use Pod::Usage 'pod2usage';
use App::Dest;

my @commands = qw(
    init add rm
    watches putwatch writewatch
    make expand list prereqs
    status diff clean preinstall
    deploy redeploy revdeploy verify revert update
    man version
);

my ( $command, @args ) = @ARGV;
( $command = lc( $command || 'undef' ) ) =~ s/^\-+//;
my @command = grep { index( $_, $command ) == 0 } @commands;
($command) = @command;

sub usage {
    pod2usage(
        '-exitval'  => 1,
        '-verbose'  => $_[0],
        '-input'    => 'App/Dest.pm',
        '-pathlist' => \@INC,
    );
}

usage(1) if ( not @command or @command > 1 );
usage(2) if ( $command eq 'man' );

exit App::Dest->$command(@args);

__END__

=pod

=encoding UTF-8

=head1 NAME

dest - Deployment State Manager

=head1 VERSION

version 1.23

=head1 AUTHOR

Gryphon Shafer <gryphon@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Gryphon Shafer.

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

=cut
