From 99ca63604b82120e5665302a3cb1c3355f633f1b Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 15 Mar 2021 10:23:59 +0000 Subject: [PATCH] Add dumb completion to add-sshkey --- bash/.bash_functions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bash/.bash_functions b/bash/.bash_functions index 4a11904..29610c0 100644 --- a/bash/.bash_functions +++ b/bash/.bash_functions @@ -41,6 +41,11 @@ function add-sshkey() { fi } +function _add-sshkey-completions() { + COMPREPLY=( $(ls -1 ${HOME}/.ssh/id_*|cut -d'_' -f 3|cut -d'.' -f 1|sed 's/@//'|sort|uniq) ) +} +complete -F _add-sshkey-completions add-sshkey + # Switch to a simple prompt for demos (thanks Mark H for the idea) function demoprompt() { if [ ! -z ${OLDPS1+x} ]; then