From 931bf7e44e76b9ccc25d113c2fce8c10f487145a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Wed, 15 Jan 2020 13:53:20 +0100 Subject: [PATCH] add new func for pdsh completion --- bash_completion.d/pdsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bash_completion.d/pdsh diff --git a/bash_completion.d/pdsh b/bash_completion.d/pdsh new file mode 100644 index 0000000..e48c15e --- /dev/null +++ b/bash_completion.d/pdsh @@ -0,0 +1,11 @@ +#!/bin/bash + +function _pdshgroups() { + COMPREPLY=() + local CUR KEYS + CUR="${COMP_WORDS[COMP_CWORD]}" + KEYS="$(find ~/.dsh/group/* -type f -exec basename {} \;)" + COMPREPLY=( $(compgen -W "${KEYS}" -- ${CUR}) ) + return 0 +} +complete -F _pdshgroups pdsh