Skip to content

Commit 6300327

Browse files
committed
run: make args an required argument
1 parent ad1d408 commit 6300327

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

covimerage/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def write_coverage(profile_file, data_file, source):
5959
# ignore_unknown_options=True,
6060
allow_interspersed_args=False,
6161
))
62-
@click.argument('args', nargs=-1, type=click.UNPROCESSED)
62+
@click.argument('args', nargs=-1, required=True, type=click.UNPROCESSED)
6363
@click.option('--wrap-profile/--no-wrap-profile', required=False,
6464
default=True, show_default=True,
6565
help='Wrap VIM cmd with options to create a PROFILE_FILE.')

tests/test_cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,3 +711,9 @@ def test_run_report_without_data(tmpdir, runner, devnull):
711711
'Parsing profile file %s.' % devnull.name,
712712
'Error: No data to report.']
713713
assert result.exit_code == 1
714+
715+
716+
def test_run_cmd_requires_args(runner):
717+
result = runner.invoke(cli.run, [])
718+
assert 'Error: Missing argument "args".' in result.output.splitlines()
719+
assert result.exit_code == 2

0 commit comments

Comments
 (0)