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 de697a1..57e1e40 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';