There's no patch attached I could approve, so I'm not 100% sure what you want to change.
Bash completions are installed by the package (devel/arcanist-lib) and located in /usr/local/lib/php/arcanist/resources/shell/bash-completion.
So entering (or adding to your ~/.profile) this
should do the trick.
So are you requesting that the devel/arcanist package to add a symlink like the one below automatically?
ln -s ../../lib/php/arcanist/resources/shell/bash-completion \
(devel/git has an example for this)
Shouldn't be hard to do and I could do this myself of course.
(In reply to Mateusz Piotrowski from comment #0)
Note that the port already links bash completions in /usr/local/share/bash-completion/completions/arc, is this sufficient for your needs, or would you also like it to be linked in /usr/local/etc/bash_completion.d?
Actually, you were the one adding this feature in back in 2018:
Enable Bash completion.
Arcanist is shipped with a Bash completion script. The script isn't installed
in the directories of the bash-completion library so it's never activated.
This patch creates a symbolic link to the script in the directories of the
bash-completion library so that the library is able to pick up the completion
script for arc when a user requests a command completion for the first time.
Reviewed by: grembo (maintainer), mat (mentor)
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16345
(In reply to Michael Gmelin from comment #2)
Hi, sorry for not replying earlier.
The problem with the current status of the arc bash completion is that it does not actually work.
If you take a look at /usr/local/share/bash-completion/completions/arc, you'll see that it is just a shell script which tries to generate the bash completion file dynamically. It failes because it tries to paths owned by root. In fact, if you try to execute is directly, you'll see the error message:
$ bash /usr/local/share/bash-completion/completions/arc
/usr/local/share/bash-completion/completions/arc: line 11: /usr/local/lib/php/arcanist/support/shell/rules/bash-rules.sh: No such file or directory
I think that a solution to this problem would be to generate the actual bash completion file during build.
I can try to write a patch for that, but first I'd like to know if it makes any sense. Sorry for not providing all the details earlier.
(In reply to Mateusz Piotrowski from comment #3)
Ah, I actually remember fixing this script a while ago in https://svnweb.freebsd.org/ports?view=revision&revision=535310
but I didn't test it with an unprivileged user (which of course makes it fail due to missing write permissions).
Running it once as root fixes the issue of course, which is something that could be covered by pkg-message. I'm following your proposed solution though and will implement a fix shortly.
Maybe you could give it a shot once committed (I tested it locally already, just to make sure it really scratches your itch).
A commit references this bug:
Date: Tue Jan 12 19:09:04 UTC 2021
New revision: 561370
Generate bash completion rules on install.
So it won't have to be done by root manually/implicitly.
Reported by: 0mp
Closing this, please let me know in case the fix doesn't work for you.
Thanks a lot, I've just installed the lastest port and it works like a charm.