Created
November 29, 2012 09:26
-
-
Save alfasado/4167792 to your computer and use it in GitHub Desktop.
Template for MT::Tool::Foo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
package MT::Tool::Foo; | |
use strict; | |
use warnings; | |
use File::Spec; | |
use FindBin; | |
use lib map File::Spec->catdir( $FindBin::Bin, File::Spec->updir, $_ ), qw/lib extlib/; | |
use base qw( MT::Tool ); | |
sub usage { '--debug 1' } | |
sub help { | |
return q { | |
Description Foo. | |
--debug 1 | |
}; | |
} | |
my ( $debug ); | |
sub options { | |
return ( | |
'debug=s' => \$debug, | |
); | |
} | |
sub main { | |
my $class = shift; | |
my ( $verbose ) = $class->SUPER::main( @_ ); | |
if ( $debug ) { | |
print 'Some debug message.' ."\n"; | |
} | |
# Do something. | |
1; | |
} | |
__PACKAGE__->main() unless caller; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment