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

Fix bug in special case shorthand docs #579

Merged
merged 1 commit into from
Jan 2, 2014
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
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