click-contrib / click-repl

Subcommand REPL for click apps
MIT License
219 stars 40 forks source link

Add a `shortest_only` option #105

Closed ZanyMonk closed 1 year ago

ZanyMonk commented 1 year ago

The ClickCompleter can now receive a shortest_only keyword argument.

If set to True, only the shortest version of each option will be shown by default (ie. if we keep pressing Tab & Space).

Before

> cmd <TAB>
            --verbose
            -v
> cmd -<TAB>
            --verbose
            -v

After

> cmd <TAB>
            -v
> cmd -<TAB>
            --verbose
            -v
ZanyMonk commented 1 year ago

Fixed the format to fit flake8 test.

auvipy commented 1 year ago

@GhostOps77

GhostOps77 commented 1 year ago

@auvipy yep, this one looks good too! and works very well. You can merge this PR without any issues.