kislyuk / argcomplete

Python and tab completion, better together.
https://kislyuk.github.io/argcomplete/
Apache License 2.0
1.39k stars 129 forks source link

Filesystem style double tab output #492

Closed alw017 closed 6 days ago

alw017 commented 1 week ago

Is it possible to implement a filesystem style autocomplete? What I want is something like this: Given a prefix "foo/", three possible completions, ["foo/b.txt", "foo/c.txt", "foo/d.txt"], I want the output to display

b.txt c.txt d.txt

and given a prefix "foo/b", it should autocomplete to "foo/b.txt". I haven't found anything on the documentation hinting at supporting this behavior, but is it possible to override CompletionFinder to achieve this?

kislyuk commented 5 days ago

Sorry I didn't respond sooner, but just for completeness: this is already how completions work. The shell completion engine will automatically do what you describe for you, there is no need for extra configuration overrides.