chiark / gitweb /
Convert to defvalopt: -k
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 04d67f3e8dc3bb6f887bdf85ef0c0646a64c25ae..6ca1f33b38fdfb8408d5bf88203ddcbb94bf32af 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3124,11 +3124,21 @@ sub defvalopt ($$$$) {
 
 defvalopt '--since-version', '-v', '[^_]+|_', \$changes_since_version;
 defvalopt '--distro',        '-d', '.+',      \$idistro;
+defvalopt '',                '-k', '.+',      \$keyid;
 defvalopt '--existing-package','', '.*',      \$existing_package;
 defvalopt '--build-products-dir','','.*',     \$buildproductsdir;
 defvalopt '--clean',       '', $cleanmode_re, \$cleanmode;
 defvalopt '--quilt',     '', $quilt_modes_re, \$quilt_mode;
 
+defvalopt '', '-c', '.*=.*', sub { push @git, '-c', @_; };
+
+defvalopt '', '-C', '.+', sub {
+    ($changesfile) = (@_);
+    if ($changesfile =~ s#^(.*)/##) {
+       $buildproductsdir = $1;
+    }
+};
+
 defvalopt '--initiator-tempdir','','.*', sub {
     ($initiator_tempdir) = (@_);
     $initiator_tempdir =~ m#^/# or
@@ -3236,17 +3246,6 @@ sub parseopts () {
                    push @ropts, $&;
                    push @changesopts, $_;
                    $_ = '';
-               } elsif (s/^-c(.*=.*)//s) {
-                   push @ropts, $&;
-                   push @git, '-c', $1;
-               } elsif (s/^-C(.+)//s) {
-                   push @ropts, $&;
-                   $changesfile = $1;
-                   if ($changesfile =~ s#^(.*)/##) {
-                       $buildproductsdir = $1;
-                   }
-               } elsif (s/^-k(.+)//s) {
-                   $keyid=$1;
                } elsif (m/^-[dCk]$/) {
                    badusage
  "option \`$_' requires an argument (and no space before the argument)";