-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I don't actually have any clue what's going on here, but I've tracked the misbehavior down to a specific commit, with a failing test fails on this commit, but succeeds on the previous commit.
Let's start with the test case:
def test_bad_command(runner):
@click.group()
def cli():
pass
@cli.command()
def wups():
pass
result = runner.invoke(cli, ['other'])
assert 'No such command' in result.output
result = runner.invoke(cli, ['/other'])
assert 'No such command' in result.output
This probably explains the issue better. In normal situations, we'd expect some call to cli other
to come back and error with "No such command ...", but in the case if prefixing with a forward slash, it somehow tricks the parser into ignoring the entire argument and instead, we get the help of the parent command.
This behavior seems to be broken starting with commit 0a2919f, and the tests fail when applied here, but pass when applied against e68766c.
Let me know if there's more information I can provide to help find the issue.
To add to it, in terms of releases, this means the behavior worked against Click 5.1, but has failed since Click 6.0 and continues to not work through latest master.