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

Update example to favor query arg over jq #578

Merged
merged 1 commit into from
Jan 2, 2014
Merged
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
6 changes: 3 additions & 3 deletions awscli/examples/s3api/list-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ List the Objects in a Bucket

The following example uses the ``list-objects`` command to display the names of all the objects in the specified bucket::

aws s3api list-objects --bucket text-content | jq ".Contents[] | {Key, Size }
aws s3api list-objects --bucket text-content --query 'Contents[].{Key: Key, Size: Size}'

The example uses jq_ to filter the output of ``list-objects`` down to the key value and size for each object
The example uses the ``--query`` argument to filter the output of
``list-objects`` down to the key value and size for each object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there previous reference in this file to the syntax for this? If not, perhaps including a link to what the user can provide as a --query would be helpful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best we can probably be is a link to the spec/reference doc but we probably should be linking more towards a tutorial type of doc (which jmespath currently does not have).

Perhaps I'll try to draft one up, then we can link to that?


For more information about objects, see `Working with Amazon S3 Objects`_ in the *Amazon S3 Developer Guide*.

.. _jq: http://stedolan.github.io/jq/
.. _`Working with Amazon S3 Objects`: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingObjects.html