chiark / gitweb /
dgit: Combine option parsing of -wd and -wdd
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 11:33:12 +0000 (12:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 11:53:31 +0000 (12:53 +0100)
We are going to introduce more variants, so we need to refactor this.

No functionalk change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index de697a15a22a1c1aeb5b84ef23e931baf30023a4..57e1e40d13d5c848b91a49ddd756d5bae27d1a78 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -7262,12 +7262,10 @@ sub parseopts () {
                } elsif (s/^-wgf$//s) {
                    push @ropts, $&;
                    $cleanmode = 'git-ff';
-               } elsif (s/^-wd$//s) {
+               } elsif (s/^-wd(d?)$//s) {
                    push @ropts, $&;
                    $cleanmode = 'dpkg-source';
-               } elsif (s/^-wdd$//s) {
-                   push @ropts, $&;
-                   $cleanmode = 'dpkg-source-d';
+                   $cleanmode .= '-d' if $1;
                } elsif (s/^-wc$//s) {
                    push @ropts, $&;
                    $cleanmode = 'check';