radian-software / pass-ln

🔑 Pass extension for creating symbolic links.
MIT License
13 stars 2 forks source link

Bash Tab Completion #2

Closed rylancates closed 2 years ago

rylancates commented 2 years ago

Hi there,

First of all - thank you so much for putting this together! This is exactly what I was looking for. I was redirected here from libera.chat in response to multiple urls per username/password.

Now, one thing that I'd love to see is bash tab completion to really round this excellent extension out :)

Thanks again and kudos!

raxod502 commented 2 years ago

Ah, okay, based on this text

                # To add completion for an extension command define a function like this:
                # __password_store_extension_complete_<COMMAND>() {
                #     COMPREPLY+=($(compgen -W "-o --option" -- ${cur}))
                #     _pass_complete_entries 1
                # }
                #
                # and add the command to the $PASSWORD_STORE_EXTENSION_COMMANDS array
                if [[ " ${PASSWORD_STORE_EXTENSION_COMMANDS[*]} " == *" ${COMP_WORDS[1]} "* ]] && type "__password_store_extension_complete_${COMP_WORDS[1]}" &> /dev/null; then
                        "__password_store_extension_complete_${COMP_WORDS[1]}"
                fi

it looks like that should be possible - so, good suggestion, I can do that in the future bandwidth permitting, or will review a PR.

raxod502 commented 2 years ago

Added with https://github.com/radian-software/pass-ln/pull/4. I am making a new release now.

rylancates commented 2 years ago

Thank you!