iterative / shtab

↔️ Automagic shell tab completion for Python CLI applications
https://docs.iterative.ai/shtab
Other
375 stars 34 forks source link

bash: compopt not supported in custom complete-functions #77

Open NiklasReisser opened 2 years ago

NiklasReisser commented 2 years ago

Hi,

I found that I can't use compopt (e.g. to set -o nospace) in custom bash completion functions.

This is due to the function in question being executed in a subshell.

It would be great to support this.

The easiest and most stable solution seems to be to write to a tmpfile and read that back in the next step. I'll open a PR for this, but I am also happy to discuss other solutions!

Thanks in advance!

NiklasReisser commented 2 years ago

(Not really sure whats up the Sourcery Refactored PR - never used Sourcery before.)