scop / bash-completion

Programmable completion functions for bash
GNU General Public License v2.0
2.92k stars 380 forks source link

Adding doas support. #505

Open Scupake opened 3 years ago

Scupake commented 3 years ago

Can someone please add support for doas?

scop commented 3 years ago

Have you asked if upstream doas project would be interested int creating or maintaining one?

Scupake commented 3 years ago

No, I haven't, I guess I could open an issue for OpenDoas, which is the version used in Void, Debian, Ubuntu and Gentoo.

chunzu commented 3 years ago

Can someone please add support for doas?

Just copy sudo file from completions directory and rename it to doas. Then search and replace all occurrences of sudo in this file with doas. Wait for a proper solution :)

fethomm commented 3 years ago

That helps some, but not with completion for apt in Debian. Do you have an idea how to work around that?

chunzu commented 3 years ago

Hello. I'm on Debian as well. Completion for apt commands work fine.

This is my /etc/doas.conf: permit keepenv nopass USER as root

Without "keepenv" you can't start GUI applications. But even with this, there are some errors about DBUS and others. So please do not launch GUIs as it can break your system.

Also on a second line of doas completion file, add this: PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin

To fix "command not found" error for programs in /usr/sbin.

Sorry, I can not help you more than this. We have to wait when somebody implements it.

fethomm commented 3 years ago

Thanks, that helped!

Scupake commented 3 years ago

Opendoas' maintainer has said in a reddit comment that they won't add any feature unless it is in upstream doas, which is unlikely to add bash support because iirc they use ksh on openbsd

scop commented 3 years ago

OpenBSD has bash-completion in their ports tree, https://openports.se/shells/bash-completion

akinomyoga commented 1 year ago

Ref. PR https://github.com/Duncaen/OpenDoas/pull/84 in OpenDoas

kzwkt commented 1 year ago

you can get completion by symlinking doas as sudo if you only use doas example : doas ln -s /usr/bin/doas $HOME/.local/bin/sudo