From 6946e0217cd15ef10612c7fc22d6f7f42af7a10a Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 19 Feb 2021 16:21:27 -0500 Subject: [PATCH] Add check for redundant --csv and --csv-file usage. Add TODO for future reporting style output. --- nucypher/cli/commands/status.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nucypher/cli/commands/status.py b/nucypher/cli/commands/status.py index 62314d5b9..80c1f794e 100644 --- a/nucypher/cli/commands/status.py +++ b/nucypher/cli/commands/status.py @@ -183,8 +183,14 @@ def events(general_config, registry_options, contract_name, from_block, to_block # csv output file csv_output_file = csv_file if csv or csv_output_file: + if csv and csv_file: + raise click.BadOptionUsage(option_name='--event-filter', + message=f'Pass either --csv or --csv-file, not both.') + # ensure that event name is specified - different events would have different columns in the csv file if not event_name: + # TODO consider a single csv that just gets appended to for each event + # (including headers) - report-type functionality, see #2561 raise click.BadOptionUsage(option_name='--csv, --csv-file, --event-name', message='Event name must be specified to output events to csv file') if not csv_output_file: