Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added help for action-alias match & execute #4174

Merged
merged 3 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Fixed

Contributed by Nick Maludy (Encore Technologies).
* Style clean up to transport queues module and various config modules. (improvement)
* Fixed CLI help for ``st2 action-alias match`` and ``execute``. (#4174).

2.7.2 - May 16, 2018
--------------------
Expand Down
16 changes: 6 additions & 10 deletions st2client/st2client/commands/action_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def __init__(self, description, app, subparsers, parent_parser=None):

self.commands['match'] = ActionAliasMatchCommand(
self.resource, self.app, self.subparsers,
add_help=False)
add_help=True)
self.commands['execute'] = ActionAliasExecuteCommand(
self.resource, self.app, self.subparsers,
add_help=False)
add_help=True)


class ActionAliasListCommand(resource.ContentPackResourceListCommand):
Expand All @@ -69,10 +69,8 @@ def __init__(self, resource, *args, **kwargs):

self.parser.add_argument('match_text',
metavar='command',
help=help)
self.parser.add_argument('-h', '--help',
action='store_true', dest='help',
help='Print usage for the given action.')
help=('Get the list of %s that match the command text.' %
resource.get_display_name().lower()))
self.parser.add_argument('-a', '--attr', nargs='+',
default=self.display_attributes,
help=('List of attributes to include in the '
Expand Down Expand Up @@ -108,10 +106,8 @@ def __init__(self, resource, *args, **kwargs):

self.parser.add_argument('command_text',
metavar='command',
help=help)
self.parser.add_argument('-h', '--help',
action='store_true', dest='help',
help='Print usage for the given action.')
help=('Execute the command text by finding a matching %s.' %
resource.get_display_name().lower()))
self.parser.add_argument('-u', '--user', type=str, default=None,
help='User under which to run the action (admins only).')

Expand Down