Skip to content

Commit

Permalink
Fix(generate-event): SubCommand help text to be short-text. (aws#652)
Browse files Browse the repository at this point in the history
The help text for the SubCommands in generate-event were getting truncated
in the terminal. The help text being displayed was the short_help text and not
the full text. If a click command does not have short_text assoicated, click
will truncate the help text to 45 characters.  We will now set the short_text
to be the full text to allow the contents to be displayed on the screen.

* Update unit tests
  • Loading branch information
jfuss authored and sanathkr committed Sep 7, 2018
1 parent ab48a0c commit 2f08ba6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion samcli/commands/local/generate_event/event_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get_command(self, ctx, cmd_name):
self.top_level_cmd_name,
cmd_name)
cmd = click.Command(name=cmd_name,
help=self.subcmd_definition[cmd_name]["help"],
short_help=self.subcmd_definition[cmd_name]["help"],
params=parameters,
callback=command_callback)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_subcommand_get_command_return_value(self, click_mock, functools_mock, o
s = EventTypeSubCommand(self.events_lib_mock, "hello", all_commands)
s.get_command(None, "hi")
click_mock.Command.assert_called_once_with(name="hi",
help="Generates a hello Event",
short_help="Generates a hello Event",
params=[],
callback=callback_object_mock)

Expand Down

0 comments on commit 2f08ba6

Please sign in to comment.