chiark / gitweb /
Complain about lack of cuddled values for value-taking single-letter options, rather...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Nov 2014 15:12:42 +0000 (15:12 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Nov 2014 15:12:42 +0000 (15:12 +0000)
debian/changelog
dgit

index 6152a28f7315ada4ce908752b107f8934f8e4e74..f035107a0fd9fa8d1cf4cccd89c69f7925dc727d 100644 (file)
@@ -47,6 +47,10 @@ dgit (0.23~) unstable; urgency=low
     unconditionally invoke curl and have no code to use wget.
     Closes:#760805.
 
+  * Complain about lack of cuddled values for value-taking single-letter
+    options, rather than thinking the user meat an empty value.
+    Closes:#763332.
+
  --
 
 dgit (0.22.1) unstable; urgency=high
diff --git a/dgit b/dgit
index d936acdfecb30da0aea88a5f808d4f594855acde..839f93ffe04b34509e6b4131979e231eb65ca3aa 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2718,17 +2718,20 @@ sub parseopts () {
                } elsif (s/^-c(.*=.*)//s) {
                    push @ropts, $&;
                    push @git, '-c', $1;
-               } elsif (s/^-d(.*)//s) {
+               } elsif (s/^-d(.+)//s) {
                    push @ropts, $&;
                    $idistro = $1;
-               } elsif (s/^-C(.*)//s) {
+               } elsif (s/^-C(.+)//s) {
                    push @ropts, $&;
                    $changesfile = $1;
                    if ($changesfile =~ s#^(.*)/##) {
                        $buildproductsdir = $1;
                    }
-               } elsif (s/^-k(.*)//s) {
+               } elsif (s/^-k(.+)//s) {
                    $keyid=$1;
+               } elsif (m/^-[vdCk]$/) {
+                   badusage
+ "option \`$_' requires an argument (and no space before the argument)";
                } elsif (s/^-wn//s) {
                    push @ropts, $&;
                    $cleanmode = 'none';