+sub maybe_warn_opt_confusion ($$$) {
+ my ($subcommand, $willrun, $optsref) = @_;
+ foreach (@$optsref) {
+ if (m/^(?: --dry-run $
+ | --damp-run $
+ | --clean= | -w[gcnd]
+ | --(?:include|ignore)-dirty$
+ | --quilt= | --gbp$ | --dpm$ | --baredebian
+ | --split-view=
+ | --build-products-dir=
+ )/x) {
+ print STDERR f_ <<END, $&, $subcommand or die $!;
+warning: dgit option %s must be passed before %s on dgit command line
+END
+ } elsif (m/^(?: -C
+ | --no-sign $
+ | -k
+ )/x) {
+ print STDERR f_ <<END, $&, $subcommand, $willrun or die $!;
+warning: option %s should probably be passed to dgit before %s sub-command on the dgit command line, so that it is seen by dgit and not simply passed to %s
+END
+ }
+ }
+}
+