chiark / gitweb /
Convert to defvalopt: --build-products-dir
[dgit.git] / dgit
diff --git a/dgit b/dgit
index b9982bbbefb656f36a578595a3752cedd7145e09..5baa5b5c7ceb9d22713f9d5a123438280d9652b1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3123,8 +3123,16 @@ sub defvalopt ($$$$) {
 }
 
 defvalopt '--since-version', '-v', '[^_]+|_', \$changes_since_version;
-defvalopt '--distro', '-d', '.+', \$idistro;
-defvalopt '--existing-package', '', '.*', \$existing_package;
+defvalopt '--distro',        '-d', '.+',      \$idistro;
+defvalopt '--existing-package','', '.*',      \$existing_package;
+defvalopt '--build-products-dir','','.*',     \$buildproductsdir;
+
+defvalopt '--initiator-tempdir','','.*', sub {
+    ($initiator_tempdir) = (@_);
+    $initiator_tempdir =~ m#^/# or
+       badusage "--initiator-tempdir must be used specify an".
+       " absolute, not relative, directory."
+};
 
 sub parseopts () {
     my $om;
@@ -3187,14 +3195,6 @@ sub parseopts () {
                     ($om = $opts_opt_map{$1})) {
                push @ropts, $_;
                push @$om, $2;
-           } elsif (m/^--initiator-tempdir=(.*)/s) {
-               $initiator_tempdir = $1;
-               $initiator_tempdir =~ m#^/# or
-                   badusage "--initiator-tempdir must be used specify an".
-                       " absolute, not relative, directory."
-           } elsif (m/^--build-products-dir=(.*)/s) {
-               push @ropts, $_;
-               $buildproductsdir = $1;
            } elsif (m/^--clean=($cleanmode_re)$/os) {
                push @ropts, $_;
                $cleanmode = $1;