chiark / gitweb /
dgit: Provide --program!:option
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Jan 2019 20:27:06 +0000 (20:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Jan 2019 20:27:06 +0000 (20:27 +0000)
Apropos of #904862.

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

diff --git a/dgit b/dgit
index c62d1cc..a5f9314 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -7192,6 +7192,12 @@ sub parseopts () {
                     ($om = $opts_opt_map{$1})) {
                push @ropts, $_;
                push @$om, $2;
+           } elsif (m/^--([-0-9a-z]+)\!:(.*)/s &&
+                    !$opts_opt_cmdonly{$1} &&
+                    ($om = $opts_opt_map{$1})) {
+               push @ropts, $_;
+               my $cmd = shift @$om;
+               @$om = ($cmd, grep { $_ ne $2 } @$om);
            } elsif (m/^--(gbp|dpm)$/s) {
                push @ropts, "--quilt=$1";
                $quilt_mode = $1;
diff --git a/dgit.1 b/dgit.1
index 422a363..993d50b 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -1079,6 +1079,24 @@ and the
 .B keyid
 distro config setting.
 .TP
+.RI \fB--curl!:\fR option " | \fB--dput!:\fR" option " |..."
+Specifies an option to remove from the command line for
+a program called by dgit, as for
+\fB--\fR\fIprogram\fI\fB:\fR\fIoption\fR
+(and the same caveats apply).
+
+Any options or arguments exactly identical to
+.I option
+are removed.
+(It is not an error if there were none.)
+
+This can only be used to delete options
+which are always passed by default by dgit,
+or to undo a previous
+\fB--\fR\fIprogram\fI\fB:\fR\fIoption\fR.
+It cannot be used to override option(s) dynamically
+decided on by dgit.
+.TP
 .RI \fB--curl=\fR program " | \fB--dput=\fR" program  " |..."
 Specifies alternative programs to use instead of
 .BR curl ,