easy-rsa icon indicating copy to clipboard operation
easy-rsa copied to clipboard

add initial support for easyrsa bash completion

Open eric-belhomme opened this issue 5 years ago • 5 comments

Hello,

The easyrsa CLI is powerful but a bit tricky to use as it support many arguments. Even worst, positional arguments matters ! That's why a started to write a bash completion function to ease daily easyrsa usage.

As I wonder this could be helpful for many others users I propose this PR.

To use it, just source easyrsa.completion from your ~/.bashrc:

source easyrsa3/easyrsa.completion

Then enjoy ! Eric

eric-belhomme avatar Oct 04 '20 07:10 eric-belhomme

Please run this script through https://www.shellcheck.net/

wiscii avatar Oct 04 '20 16:10 wiscii

Please run this script through https://www.shellcheck.net/

Hello, Thanks for the link, I didn't knew that tool ! I made a first pass. There is still some warnings related to the way the $COMPREPLY array is built, but that's the usual method seen everywhere on bash completion scripts so I prefer keep it untouched.

eric-belhomme avatar Oct 04 '20 18:10 eric-belhomme

@eric-belhomme easyrsa has some new commands:

  • show-expire, show-revoke, show-renew and renewable
  • revoke-renewed and rewind-renew

Could you please add those to the script ?

The patch to add these new options would also help to serve as documentation of how to do this in future.

TinCanTech avatar Jun 13 '22 14:06 TinCanTech

If you can support bash completion for EasyRSA then, please, feel free to reopen.

Until then, closed as not planned.

TinCanTech avatar Apr 13 '23 23:04 TinCanTech

As soon as I closed this I changed my mind. Sorry for the noise.

Re-opened as "would really like this but want help".

I have put a lot of work into EasyRSA, so there were a lot of changes. This made it difficult to provide bash-completion out-of-the-box.

Now that EasyRSA version 3.1 is stabilizing, bash-completion is a viable addition.

"Volunteers" ....

TinCanTech avatar Apr 14 '23 00:04 TinCanTech