click-contrib / click-repl

Subcommand REPL for click apps
MIT License
215 stars 41 forks source link

Fix values shown for wrong option #106

Closed ZanyMonk closed 12 months ago

ZanyMonk commented 1 year ago

When completing option values, only values corresponding to the option being completed should be shown.

Following exemples are based on a command looking like this:

@click.command()
@click.option('-a', type=click.Choice(['a_val1', 'a_val2']))
@click.option('-b', type=click.Choice(['b_val1', 'b_val2']))
def cli():
    pass

Before

> cmd -a <TAB>
               a_val1
               a_val2
               b_val1
               b_val2

After

> cmd -a <TAB>
               a_val1
               a_val2
auvipy commented 12 months ago

@GhostOps77 can you try and review it please?

GhostOps77 commented 12 months ago

@auvipy yep, everything looks good and works well as expected! No issues in here You can merge this PR