From patchwork Mon Aug 18 19:07:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 381097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 680B01400FA for ; Tue, 19 Aug 2014 05:14:36 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 423671A0222 for ; Tue, 19 Aug 2014 05:14:36 +1000 (EST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org X-Greylist: delayed 391 seconds by postgrey-1.34 at bilbo; Tue, 19 Aug 2014 05:14:34 AEST Received: from grace.univie.ac.at (grace.univie.ac.at [IPv6:2001:62a:4:25::25:115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id E8EFD1A003F for ; Tue, 19 Aug 2014 05:14:34 +1000 (EST) Received: from jarvis.univie.ac.at ([131.130.3.112] helo=jarvis.univie.ac.at) by grace.univie.ac.at with esmtp (Exim 4.83) (envelope-from ) id 1XJSHb-00073a-1A; Mon, 18 Aug 2014 21:07:55 +0200 Received: from [2001:62a:4:203:2e59:e5ff:feb9:72ed] (helo=nbbrfq.loc) by jarvis.univie.ac.at with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XJSHa-0002qi-WF; Mon, 18 Aug 2014 21:07:55 +0200 Received: from b by nbbrfq.loc with local (Exim 4.84_RC1) (envelope-from ) id 1XJSHa-0000dM-Sx; Mon, 18 Aug 2014 21:07:54 +0200 From: Bernhard Reutner-Fischer To: jk@ozlabs.org Subject: [PATCH 3/4] pwclient: Remove now obsolete usage() Date: Mon, 18 Aug 2014 21:07:50 +0200 Message-Id: <1408388871-2372-4-git-send-email-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1408388871-2372-1-git-send-email-rep.dot.nop@gmail.com> References: <1408388871-2372-1-git-send-email-rep.dot.nop@gmail.com> X-Univie-Virus-Scan: scanned by ClamAV on jarvis.univie.ac.at Cc: Bernhard Reutner-Fischer , patchwork@lists.ozlabs.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Signed-off-by: Bernhard Reutner-Fischer --- apps/patchwork/bin/pwclient | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index a31099d..a58e949 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -106,36 +106,6 @@ class BasicHTTPAuthTransport(xmlrpclib.SafeTransport): fn = xmlrpclib.Transport.make_connection return fn(self, host) -def usage(): - sys.stderr.write("Usage: %s [options]\n\n" % \ - (os.path.basename(sys.argv[0]))) - sys.stderr.write("Where is one of:\n") - sys.stderr.write( -""" apply : Apply a patch (in the current dir, using -p1) - git-am : Apply a patch to current git branch using "git am" - get : Download a patch and save it locally - info : Display patchwork info about a given patch ID - projects : List all projects - states : Show list of potential patch states - list [str] : List patches, using the optional filters specified - below and an optional substring to search for patches - by name - search [str] : Same as 'list' - view : View a patch - update [-s state] [-c commit-ref] - : Update patch\n""") - sys.stderr.write("""\nFilter options for 'list' and 'search': - -s : Filter by patch state (e.g., 'New', 'Accepted', etc.) - -p : Filter by project name (see 'projects' for list) - -w : Filter by submitter (name, e-mail substring search) - -d : Filter by delegate (name, e-mail substring search) - -n : Restrict number of results - -m : Filter by Message-Id\n""") - sys.stderr.write("""\nActions that take an ID argument can also be \ -invoked with: - -h : Lookup by patch hash\n""") - sys.exit(1) - def project_id_by_name(rpc, linkname): """Given a project short name, look up the Project ID.""" if len(linkname) == 0: @@ -581,7 +551,8 @@ def main(): project_str = config.get('options', 'default') except: sys.stderr.write("No default project configured in ~/.pwclientrc\n") - usage() + action_parser.print_help() + sys.exit(1) if not config.has_section(project_str): sys.stderr.write("No section for project %s\n" % project_str) @@ -671,7 +642,8 @@ def main(): else: sys.stderr.write("Unknown action '%s'\n" % action) - usage() + action_parser.print_help() + sys.exit(1) if __name__ == "__main__": main()