aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mchucarr...@apache.org
Subject git commit: Add a short form of help for v1 client, so that merged help isn't unreasonably long.
Date Tue, 10 Jun 2014 14:44:55 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 5665d4ce8 -> 18c35b551


Add a short form of help for v1 client, so that merged help isn't unreasonably long.

Bugs closed: aurora-422

Reviewed at https://reviews.apache.org/r/22263/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/18c35b55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/18c35b55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/18c35b55

Branch: refs/heads/master
Commit: 18c35b5519611d47621be3625cb3d8d55f9eb473
Parents: 5665d4c
Author: Mark Chu-Carroll <mchucarroll@twopensource.com>
Authored: Tue Jun 10 10:28:33 2014 -0400
Committer: Mark Chu-Carroll <mchucarroll@twitter.com>
Committed: Tue Jun 10 10:28:33 2014 -0400

----------------------------------------------------------------------
 src/main/python/apache/aurora/client/cli/bridge.py | 5 ++++-
 src/main/python/apache/aurora/client/cli/client.py | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/18c35b55/src/main/python/apache/aurora/client/cli/bridge.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/bridge.py b/src/main/python/apache/aurora/client/cli/bridge.py
index 6528d90..227abf8 100644
--- a/src/main/python/apache/aurora/client/cli/bridge.py
+++ b/src/main/python/apache/aurora/client/cli/bridge.py
@@ -41,6 +41,9 @@ class CommandProcessor(object):
     """Get a list of the commands that this processor can handle."""
     pass
 
+  def show_help(self):
+    self.execute(["", "help"])
+
 
 class Bridge(object):
   """Given multiple command line programs, each represented by a "CommandProcessor" object,
@@ -64,7 +67,7 @@ class Bridge(object):
           [cp.name for cp in self.command_processors])
       for cp in self.command_processors:
         print("========== help for %s ==========" % cp.name)
-        cp.execute(args)
+        cp.show_help()
       return 0
     elif len(args) >= 3:
       discriminator = args[2]

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/18c35b55/src/main/python/apache/aurora/client/cli/client.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/client.py b/src/main/python/apache/aurora/client/cli/client.py
index e4409e5..0cb6944 100644
--- a/src/main/python/apache/aurora/client/cli/client.py
+++ b/src/main/python/apache/aurora/client/cli/client.py
@@ -46,6 +46,10 @@ class AuroraClientV1CommandProcessor(CommandProcessor):
   def name(self):
     return "Aurora Client v1"
 
+  def show_help(self):
+    print("Supported commands are: %s" % ", ".join(self.get_commands()))
+    print("\nRun '%s help _command_' for help on a specific command" % sys.argv[0])
+
   def get_commands(self):
     return ["cancel_update", "create", "diff", "get_quota", "inspect", "kill", "list_jobs",
         "open", "restart", "run", "ssh", "start_cron", "status", "update", "version"]


Mime
View raw message