You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by kl...@apache.org on 2017/09/22 12:00:21 UTC

mesos git commit: Added the ability for a plugin command to have an alias in the CLI.

Repository: mesos
Updated Branches:
  refs/heads/master 548aaee3a -> ae89b19ff


Added the ability for a plugin command to have an alias in the CLI.

This will be used by future plugins.

Review: https://reviews.apache.org/r/60087/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ae89b19f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ae89b19f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ae89b19f

Branch: refs/heads/master
Commit: ae89b19ff4bb31d34645ead58edc5ccc98959807
Parents: 548aaee
Author: Armand Grillet <ag...@mesosphere.io>
Authored: Fri Sep 22 04:58:57 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Fri Sep 22 04:58:57 2017 -0700

----------------------------------------------------------------------
 src/python/cli_new/lib/cli/plugins/base.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ae89b19f/src/python/cli_new/lib/cli/plugins/base.py
----------------------------------------------------------------------
diff --git a/src/python/cli_new/lib/cli/plugins/base.py b/src/python/cli_new/lib/cli/plugins/base.py
index edbe1ec..e01a7b2 100644
--- a/src/python/cli_new/lib/cli/plugins/base.py
+++ b/src/python/cli_new/lib/cli/plugins/base.py
@@ -171,6 +171,9 @@ class PluginBase(object):
                     version=self.VERSION,
                     options_first=True)
 
+            if "alias" in self.COMMANDS[cmd]:
+                cmd = self.COMMANDS[cmd]["alias"]
+
             self.__setup__(cmd, argv)
             getattr(self, cmd.replace("-", "_"))(arguments)
         else: