chiark / gitweb /
Finish dealing with uncuddled options
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 24772a90efb37c729fead5388573c884d1196798..eb9a97c3d0269604ca3bd1a1995510b79b4341ba 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3124,6 +3124,7 @@ 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;
@@ -3131,6 +3132,13 @@ 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
@@ -3238,17 +3246,6 @@ sub parseopts () {
                    push @ropts, $&;
                    push @changesopts, $_;
                    $_ = '';
-               } 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)";
                } elsif (s/^-wn$//s) {
                    push @ropts, $&;
                    $cleanmode = 'none';