Skip to content

Commit

Permalink
Fix bug in special case shorthand docs
Browse files Browse the repository at this point in the history
For structures of a single element that weren't named
``Value``, we weren't returning the value from
_docs_key_value_parse.

Fixes #566.
  • Loading branch information
jamesls committed Jan 2, 2014
1 parent 9cc7717 commit c906642
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion awscli/argprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _docs_special_key_value_parse(self, param):
# should be skipped for this arg.
return None
else:
self._docs_key_value_parse(param)
return self._docs_key_value_parse(param)

def _docs_key_value_parse(self, param):
s = '%s ' % param.cli_name
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/docs/test_help_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ def test_no_examples_for_structure_single_scalar(self):
self.assert_not_contains('"Value": "string"')
self.assert_not_contains('Value=string')

def test_example_for_single_structure_not_named_value(self):
# Verify that if a structure does match our special case
# (single element named "Value"), then we still document
# the example syntax.
self.driver.main(['s3api', 'restore-object', 'help'])
self.assert_contains('Days=value')
# Also should see the JSON syntax in the help output.
self.assert_contains('"Days": integer')


class TestJSONListScalarDocs(BaseAWSHelpOutputTest):
def test_space_separated_list_docs(self):
Expand Down

0 comments on commit c906642

Please sign in to comment.