chiark / gitweb /
Convert to defvalopt: --initiator-tempdir
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 5b44af6bcb351b38c8ac76cd44949883db34f6fa..5215a5aac6498ed03714671fa1a227ad8907fceb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3126,6 +3126,13 @@ defvalopt '--since-version', '-v', '[^_]+|_', \$changes_since_version;
 defvalopt '--distro',        '-d', '.+',      \$idistro;
 defvalopt '--existing-package','', '.*',      \$existing_package;
 
+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,11 +3194,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;