chiark / gitweb /
dgit: clean mode: Refactor -wg parsing to prep for suffixes
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 37d38618572b90ce5514941021ff00355059dc48..55c8070163c118f3925110785964ee2f1bb9ce88 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -102,7 +102,7 @@ our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)");
 
 our $suite_re = '[-+.0-9a-z]+';
 our $cleanmode_re = qr{(?: dpkg-source (?: -d )? (?: ,no-check | ,all-check )?
-                         | git | git-ff
+                     | (?: git | git-ff )
                          | check (?: ,ignores )?
                          | none
                          )}x;
@@ -7298,12 +7298,10 @@ sub parseopts () {
                } elsif (s/^-wn$//s) {
                    push @ropts, $&;
                    $cleanmode = 'none';
-               } elsif (s/^-wg$//s) {
+               } elsif (s/^-wg(f?)$//s) {
                    push @ropts, $&;
                    $cleanmode = 'git';
-               } elsif (s/^-wgf$//s) {
-                   push @ropts, $&;
-                   $cleanmode = 'git-ff';
+                   $cleanmode .= '-ff' if $1;
                } elsif (s/^-wd(d?)([na]?)$//s) {
                    push @ropts, $&;
                    $cleanmode = 'dpkg-source';