From 787f5f43cb6e8fb1a012115f979049375f6910b1 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 16 May 2013 21:15:35 +0200 Subject: bin/hostinfo: add --keys to get valid keys for a host The bash completion uses now a dynamic list of valid keys for a host and therefor calls the hostinfo tool itself. --- contrib/bash-completion | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/bash-completion') diff --git a/contrib/bash-completion b/contrib/bash-completion index d5a4a1f..31bc6f8 100644 --- a/contrib/bash-completion +++ b/contrib/bash-completion @@ -12,9 +12,9 @@ _hostinfo() { if [[ -z "$arg" ]]; then _completion="$_hostinfo_hosts" else - _completion="hostname os arch addresses ports vserver vserver-host" + _completion="$(hostinfo --keys $arg 2>/dev/null)" fi - COMPREPLY=( $( compgen -W "-o --oneline -f --file $_completion" -- $cur ) ) + COMPREPLY=( $( compgen -W "-o --oneline -f --file -k --keys $_completion" -- $cur ) ) } complete -F _hostinfo hostinfo -- cgit v1.2.3-1-g7c22