Organize / group sub commands together in a more logical order.
@@ -188,6 +188,9 @@ class Shell(BaseCLIApp):
self.subparsers = self.parser.add_subparsers()
self.commands = {}
+ self.commands['run'] = action.ActionRunCommand(
+ models.Action, self, self.subparsers, name='run', add_help=False)
+
self.commands['action'] = action.ActionBranch(
'An activity that happens as a response to the external event.',
self, self.subparsers)
@@ -199,6 +202,12 @@ class Shell(BaseCLIApp):
self.commands['auth'] = auth.TokenCreateCommand(
models.Token, self, self.subparsers, name='auth')
+ self.commands['login'] = auth.LoginCommand(
+ models.Token, self, self.subparsers, name='login')
+
+ self.commands['whoami'] = auth.WhoamiCommand(
+ models.Token, self, self.subparsers, name='whoami')
+
self.commands['api-key'] = auth.ApiKeyBranch(
'API Keys.',
self, self.subparsers)
@@ -212,9 +221,6 @@ class Shell(BaseCLIApp):
'for reuse in sensors, actions, and rules.',
self, self.subparsers)
- self.commands['login'] = auth.LoginCommand(
- models.Token, self, self.subparsers, name='login')
-
self.commands['pack'] = pack.PackBranch(
'A group of related integration resources: '
'actions, rules, and sensors.',
@@ -233,8 +239,13 @@ class Shell(BaseCLIApp):
'based on some criteria.',
self, self.subparsers)
- self.commands['run'] = action.ActionRunCommand(
- models.Action, self, self.subparsers, name='run', add_help=False)
+ self.commands['webhook'] = webhook.WebhookBranch(
+ 'Webhooks.',
+ self, self.subparsers)
+
+ self.commands['timer'] = timer.TimerBranch(
+ 'Timers.',
+ self, self.subparsers)
self.commands['runner'] = resource.ResourceBranch(
models.RunnerType,
@@ -258,17 +269,6 @@ class Shell(BaseCLIApp):
'Actual instances of triggers received by st2.',
self, self.subparsers)
- self.commands['webhook'] = webhook.WebhookBranch(
- 'Webhooks.',
- self, self.subparsers)
-
- self.commands['whoami'] = auth.WhoamiCommand(
- models.Token, self, self.subparsers, name='whoami')
-
- self.commands['timer'] = timer.TimerBranch(
- 'Timers.',
- self, self.subparsers)
-
self.commands['rule-enforcement'] = rule_enforcement.RuleEnforcementBranch(
'Models that represent enforcement of rules.',
self, self.subparsers)
