From: Bernhard Reutner-Fischer Date: Mon, 18 Aug 2014 19:07:50 +0000 (+0200) Subject: pwclient: Remove now obsolete usage() X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=a4875c47a1c3df9d7654169b8d68ad185585d236;p=patchwork pwclient: Remove now obsolete usage() Signed-off-by: Bernhard Reutner-Fischer Signed-off-by: Jeremy Kerr --- 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()