From da4e8ebbf9aee223c960400a7a8a283e88e6ccb2 Mon Sep 17 00:00:00 2001 From: Constantine Nathanson Date: Wed, 29 Nov 2023 17:10:33 +0200 Subject: [PATCH] Change parameter name to `-fi` --- cloudinary_cli/core/search.py | 11 ++++++++--- test/test_cli_search_api.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cloudinary_cli/core/search.py b/cloudinary_cli/core/search.py index aaf247f..126c466 100644 --- a/cloudinary_cli/core/search.py +++ b/cloudinary_cli/core/search.py @@ -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, ).") @option("-a", "--aggregate", nargs=1, help="Specify the attribute for which an aggregation count should be calculated and returned.") @@ -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) diff --git a/test/test_cli_search_api.py b/test/test_cli_search_api.py index 9a4d2bd..a2c4422 100644 --- a/test/test_cli_search_api.py +++ b/test/test_cli_search_api.py @@ -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)