From e3fabc16daca5e3ee863bff425ba77253afb99bb Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Tue, 13 May 2008 14:19:02 -0700 Subject: [PATCH] [commit-patch] Use Pod::Usage() to cut down on repetition and add an easy --help option. --- commit-patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commit-patch b/commit-patch index 4edfa7a..3974d9f 100755 --- a/commit-patch +++ b/commit-patch @@ -9,11 +9,13 @@ use Cwd qw(abs_path); use IPC::Run qw(run); use File::Temp qw(tempfile); use Getopt::Long; +use Pod::Usage; my ($message, $message_filename); GetOptions("message|m=s" => \$message, "F|message-file=s" => \$message_filename, - ) and scalar @ARGV == 1 or die "Usage: $0 [--message|-m ] [--message-file|-F ] \n"; + "h|help" => sub { pod2usage(1) }, + ) and scalar @ARGV == 1 or pod2usage(2); my $patch = shift; die "bad patch file: $!" if -z $patch; -- 2.51.2