-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I'd like to be able to specify a default for arguments with multiple values.
A currently failing test case:
import pytest
import click
from click.testing import CliRunner
@pytest.fixture(scope="function")
def runner(request):
return CliRunner()
def test_multivalue_args_with_default(runner):
@click.command()
@click.argument('files', nargs=-1, default=['arg1'])
def cmd(files):
for filename in files:
click.echo(filename)
result = runner.invoke(cmd, ['--'])
assert result.output == 'arg1\n'
Fails with:
TypeError: 'default' is not supported for nargs=-1.
I'm using click 8.0.3