Author: jamessan
Date: 2009-09-24 22:20:59 +0000 (Thu, 24 Sep 2009)
New Revision: 2010

Modified:
   trunk/debian/changelog
   trunk/scripts/mk-build-deps.pl
Log:
mk-build-deps: Use Pod::Usage to generate the --help message.  This keeps the 
message in sync with the POD instead of keeping two different texts in sync.  
(Closes: #548245)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-09-11 09:06:48 UTC (rev 2009)
+++ trunk/debian/changelog      2009-09-24 22:20:59 UTC (rev 2010)
@@ -1,7 +1,13 @@
 devscripts (2.10.56) UNRELEASED; urgency=low
 
+  [ Adam D. Barratt ]
   * NOT RELEASED YET
 
+  [ James Vega ]
+  * mk-build-deps: Use Pod::Usage to generate the --help message.  This keeps
+    the message in sync with the POD instead of keeping two different texts in
+    sync.  (Closes: #548245)
+
  -- Adam D. Barratt <[email protected]>  Fri, 11 Sep 2009 10:06:33 +0100
 
 devscripts (2.10.55) unstable; urgency=high

Modified: trunk/scripts/mk-build-deps.pl
===================================================================
--- trunk/scripts/mk-build-deps.pl      2009-09-11 09:06:48 UTC (rev 2009)
+++ trunk/scripts/mk-build-deps.pl      2009-09-24 22:20:59 UTC (rev 2010)
@@ -29,7 +29,7 @@
 
 B<mk-build-deps> --help|--version
 
-B<mk-build-deps> [-i|--install] <control file | package name> [...]
+B<mk-build-deps> [options] <control file | package name> [...]
 
 =head1 DESCRIPTION
 
@@ -80,6 +80,7 @@
 use warnings;
 use Getopt::Long;
 use File::Basename;
+use Pod::Usage;
 
 my $progname = basename($0);
 my $opt_install;
@@ -128,9 +129,9 @@
            "remove|r" => \$opt_remove,
            "tool|t=s" => \$install_tool,
            )
-    or die "Usage: $progname <control file | package name> [...]\nRun 
$progname --help for more details\n";
+    or pod2usage({ -exitval => 1, -verbose => 0 });
 
-if ($opt_help) { help(); exit 0; }
+pod2usage({ -exitval => 0, -verbose => 1 }) if ($opt_help);
 if ($opt_version) { version(); exit 0; }
 
 if (!...@argv) {
@@ -139,7 +140,7 @@
     }
 }
 
-die "Usage: $progname <control file | package name> [...]\nRun $progname 
--help for more details\n" unless @ARGV;
+pod2usage({ -exitval => 1, -verbose => 0 }) unless @ARGV;
 
 system("command -v equivs-build >/dev/null 2>&1");
 if ($?) {
@@ -218,15 +219,6 @@
     }
 }
 
-sub help {
-   print <<"EOF";
-Usage: $progname <control file> | <package name> [...]
-Valid options are:
-   --help, -h             Display this message
-   --version, -v          Display version and copyright info
-EOF
-}
-
 sub version {
     print <<"EOF";
 This is $progname, from the Debian devscripts package, version ###VERSION###



-- 
To unsubscribe, send mail to [email protected].

Reply via email to