Open teto opened 3 years ago
Do you know, that we already have a wrapper that generates the completions? The only thing we don‘t have is autodetection for using that wrapper. Considering that the wrapper can fail, I don‘t think enabling it for everything which has an optparse-applicative dependency is a wise idea.
Do you know, that we already have a wrapper that generates the completions?
do you mean "generateOptparseApplicativeCompletion" ? I didnt, I just searched for it because of your remark.
Maybe we can catch when the wrapper fails and ignore the failure (convert it to a warning) ?
I guess I would be open to a solution like that.
Probably wiser to add a setup hook to optparse-applicative
itself which would be executed by reverse dependencies of it.
I believe this is solved actually ?
Not really, it still needs some manual intervention.
I think this might accidentally companion libraries for optparse-applicative that don't provide a binary. Or packages that have optparse-applicative as a now-obsolete dependency.
Issue description
I wonder if it would be possible to autogenerate zsh/bash/fish completions for haskell packages when detecting that optparse-applicative is a direct dependency ? One could iterate over $out/bin and try to run these commands: https://github.com/pcapriotti/optparse-applicative#bash-zsh-and-fish-completions