Skip to content

add initial support for easyrsa bash completion #409

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eric-belhomme
Copy link

@eric-belhomme eric-belhomme commented Oct 4, 2020

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

@wiscii
Copy link
Contributor

wiscii commented Oct 4, 2020

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

@eric-belhomme
Copy link
Author

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.

@TinCanTech
Copy link
Collaborator

@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
Copy link
Collaborator

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

Until then, closed as not planned.

@TinCanTech TinCanTech closed this Apr 13, 2023
@TinCanTech
Copy link
Collaborator

TinCanTech commented Apr 14, 2023

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 TinCanTech reopened this Apr 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants