diff --git a/planet/cli/data.py b/planet/cli/data.py index 46a9603a..4853889c 100644 --- a/planet/cli/data.py +++ b/planet/cli/data.py @@ -468,20 +468,28 @@ async def search_delete(ctx, search_id): @translate_exceptions @coro @click.argument('search_id') -@click.argument('name') @click.argument("item_types", type=types.CommaSeparatedString(), callback=check_item_types) -@click.argument('filter', type=types.JSON()) +@click.option( + '--filter', + type=types.JSON(), + required=True, + help="""Filter to apply to search. Can be a json string, filename, + or '-' for stdin.""") +@click.option('--name', + type=str, + required=True, + help='Name of the saved search.') @click.option('--daily-email', is_flag=True, help='Send a daily email when new results are added.') @pretty async def search_update(ctx, search_id, - name, item_types, filter, + name, daily_email, pretty): """Update a saved search with the given search request. @@ -491,9 +499,9 @@ async def search_update(ctx, """ async with data_client(ctx) as cl: items = await cl.update_search(search_id, - name, item_types, filter, + name, daily_email) echo_json(items, pretty) diff --git a/tests/integration/test_data_cli.py b/tests/integration/test_data_cli.py index 3016472a..76909e8b 100644 --- a/tests/integration/test_data_cli.py +++ b/tests/integration/test_data_cli.py @@ -900,9 +900,9 @@ def test_search_update_success(invoke, result = invoke([ 'search-update', search_id, - name, item_types, - json.dumps(search_filter) + f'--filter={json.dumps(search_filter)}', + f'--name={name}' ]) assert not result.exception @@ -921,9 +921,9 @@ def test_search_update_fail(invoke, search_id, search_filter): result = invoke([ 'search-update', search_id, - name, item_types, - json.dumps(search_filter) + f'--filter={json.dumps(search_filter)}', + f'--name={name}' ]) assert result.output.startswith("Error")