kislyuk / argcomplete

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

how to prevent a completer from falling back to bash filename completion? #366

Closed ryran closed 7 months ago

ryran commented 2 years ago

Every script I work on has some arg that is so dynamic that it can't be completed, i.e., where no choices can be set, nor any custom completer. It's annoying when such args trigger bash filename completion. How can I prevent that?

The weird thing is, I feel like this was solved at some point... or at least, I feel like this hasn't always been a problem. Anyone have any ideas?

evanunderscore commented 2 years ago

Is --no-defaults what you're looking for?

Dramelac commented 1 year ago

I have the same problem... I tried to create a completer that return an empty list but argcomplete always using bash completer as fallback when the complter return no options...

Is there something i am missing ?

What do you mean @evanunderscore by --no-defaults ?

Dramelac commented 1 year ago

Okay i found it, after some digging the default bash fallback can be disabled in the register-python-argcomplete step: eval $(register-python-argcomplete --no-defaults my-script)

evanunderscore commented 7 months ago

Closing this as resolved, thanks for following up. The regression in global completion should be handled in #445.