Skip to content

Commit feeda64

Browse files
committed
Update index gen to use new API
Shorthand example generator changed its signature, so I've updated the aws shell to use the new API.
1 parent cf0059a commit feeda64

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

awsshell/makeindex.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ def index_command(index_dict, help_command):
3939
metadata['minidoc'] = remove_html(
4040
arg_obj.documentation.split('\n')[0])
4141
if SHORTHAND_DOC.supports_shorthand(arg_obj.argument_model):
42+
service_name, op_name = help_command.event_class.rsplit('.', 1)
4243
example = SHORTHAND_DOC.generate_shorthand_example(
43-
arg, arg_obj.argument_model)
44+
cli_argument=arg_obj,
45+
service_name=service_name,
46+
operation_name=op_name,
47+
)
4448
metadata['example'] = example
4549

4650
index_dict['arguments'].append('--%s' % arg)

tests/integration/test_makeindex.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ def test_can_document_all_service_commands(cloudformation_command):
4141
assert 'aws.cloudformation.create-stack' in db
4242
assert 'aws.cloudformation.delete-stack' in db
4343
assert 'SYNOPSIS' in db['aws.cloudformation.create-stack']
44+
45+
46+
def test_can_index_a_command(cloudformation_command):
47+
help_command = cloudformation_command.create_help_command()
48+
index = makeindex.new_index()
49+
makeindex.index_command(index, help_command)

0 commit comments

Comments
 (0)