Skip to content

Commit

Permalink
Change parameter name to -fi
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed Nov 29, 2023
1 parent 0375282 commit da4e8eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions cloudinary_cli/core/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
e.g. cld search cat AND tags:kitten -s public_id desc -f context -f tags -n 10
""")
@argument("query", nargs=-1)
@option("-f", "--with_field", multiple=True, help="Specify which non-default asset attributes to include in the result. You can include more than one of these options, for example, -f tags -f context.")
@option("-if", "--fields", multiple=True, help="Specify which asset attributes to include in the result (together with the default attributes) as a comma separated list. This overrides any value specified for with_field.")
@option("-f", "--with_field", multiple=True, help="Specify which non-default asset attributes to include "
"in the result. You can include more than one of these options, "
"for example, -f tags -f context.")
@option("-fi", "--fields", multiple=True, help="Specify which asset attributes to include in the result "
"(together with the default attributes) as a comma separated list. "
"This overrides any value specified for with_field.")
@option("-s", "--sort_by", nargs=2, help="Sort search results by (field, <asc|desc>).")
@option("-a", "--aggregate", nargs=1,
help="Specify the attribute for which an aggregation count should be calculated and returned.")
Expand All @@ -27,7 +31,8 @@
@option("-c", "--next_cursor", nargs=1, help="Continue a search using an existing cursor.")
@option("-A", "--auto_paginate", is_flag=True, help="Return all results. Will call Admin API multiple times.")
@option("-F", "--force", is_flag=True, help="Skip confirmation when running --auto-paginate.")
@option("-ff", "--filter_fields", multiple=True, help="Specify which attributes to show in the response. None of the others will be shown.")
@option("-ff", "--filter_fields", multiple=True, help="Specify which attributes to show in the response. "
"None of the others will be shown.")
@option("-t", "--ttl", nargs=1, default=300, help="Set the Search URL TTL in seconds. Default: 300.")
@option("-u", "--url", is_flag=True, help="Build a signed search URL.")
@option("-sq", "--search-query", is_flag=True, help="Show the search request query.", hidden=True)
Expand Down
2 changes: 1 addition & 1 deletion test/test_cli_search_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_search(self, mocker):
self.assertIn('"foo": "bar"', result.output)

def test_search_fields(self):
result = self.runner.invoke(cli, ['search', 'cat', '-if', 'url,tags', '-if', 'context', '--search-query'])
result = self.runner.invoke(cli, ['search', 'cat', '-fi', 'url,tags', '-fi', 'context', '--search-query'])

self.assertEqual(0, result.exit_code)
self.assertIn('"fields": [\n "url",\n "tags",\n "context"\n ]', result.output)
Expand Down

0 comments on commit da4e8eb

Please sign in to comment.