From 097fc7f7b6367ef814cfa7d1778e2fae207ef53c Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefanor@ubuntu.com>
Date: Mon, 18 Apr 2011 14:18:42 +0200
Subject: [PATCH] sponsor-patch, doc/sponsorpatch.1: Clarify that --upload or
 --workdir is required. (LP: #712721)

---
 debian/changelog    | 4 +++-
 doc/sponsor-patch.1 | 4 ++++
 sponsor-patch       | 6 ++++--
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f1aa704..d204337 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ ubuntu-dev-tools (0.121) UNRELEASED; urgency=low
   * ubuntutools.archive.rmadison: suite can be None, handle this correctly.
   * pull-debian-debdiff: Convert distance to an integer, so it works when
     specified.
+  * sponsor-patch, doc/sponsorpatch.1: Clarify that --upload or --workdir is
+    required. (LP: #712721)
 
   [ Benjamin Drung ]
   * ubuntutools.update-maintainer: Do not use python-debian to parse
@@ -17,7 +19,7 @@ ubuntu-dev-tools (0.121) UNRELEASED; urgency=low
   * doc/setup-packaging-environment.1: Fix typo "helps to" -> "helps one to".
   * Bump Standards-Version to 3.9.2 (no changes required).
 
- -- Benjamin Drung <bdrung@debian.org>  Sun, 17 Apr 2011 16:46:11 +0200
+ -- Stefano Rivera <stefanor@debian.org>  Mon, 18 Apr 2011 14:15:29 +0200
 
 ubuntu-dev-tools (0.120) unstable; urgency=low
 
diff --git a/doc/sponsor-patch.1 b/doc/sponsor-patch.1
index 833f2ae..aa56b5b 100644
--- a/doc/sponsor-patch.1
+++ b/doc/sponsor-patch.1
@@ -51,6 +51,10 @@ downloaded into a temporary directory in \fB/tmp\fR, which is removed once the
 script finishes running.
 The output of the build tool will be placed in \fIworkdir\fR/\fBbuildresult/\fR.
 
+.PP
+One of \fB\-\-upload\fR, \fB\-\-workdir\fR, or \fB--sponsor\fR must be
+specified.
+
 .SH OPTIONS
 .TP
 .BR \-b ", " \-\-build
diff --git a/sponsor-patch b/sponsor-patch
index b8599f2..6784c09 100755
--- a/sponsor-patch
+++ b/sponsor-patch
@@ -27,7 +27,8 @@ from ubuntutools.sponsor_patch.sponsor_patch import sponsor_patch
 
 def main():
     script_name = os.path.basename(sys.argv[0])
-    usage = "%s [options] <bug number>" % (script_name)
+    usage = ("%s [options] <bug number>\n" % (script_name)
+             + "One of --upload, --workdir, or --sponsor must be specified.")
     epilog = "See %s(1) for more info." % (script_name)
     parser = optparse.OptionParser(usage=usage, epilog=epilog)
 
@@ -58,7 +59,8 @@ def main():
     parser.add_option("-v", "--verbose", help="print more information",
                       dest="verbose", action="store_true", default=False)
     parser.add_option("-w", "--workdir", dest="workdir", default=None,
-                      help="Specify a working directory.")
+                      help="Specify a working directory (default is a "
+                           "temporary directory, deleted afterwards).")
 
     (options, args) = parser.parse_args()
     Logger.set_verbosity(options.verbose)