chiark / gitweb /
Convert to defvalopt: --build-products-dir
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 5b44af6bcb351b38c8ac76cd44949883db34f6fa..5baa5b5c7ceb9d22713f9d5a123438280d9652b1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3125,6 +3125,14 @@ sub defvalopt ($$$$) {
 defvalopt '--since-version', '-v', '[^_]+|_', \$changes_since_version;
 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;