From 27436f8b8a84fa70bba3a7b7d286fd3eba37fbfe Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 17 May 2013 15:30:52 +0200 Subject: bin/hostinfo: add support for --hosts and --short You could now use --hosts to get a listing of all available hosts with in the current basepath (set by HOSTINFO_PATH or --path or the default value /usr/local/share/hostinfo/). If you use --short you will remove the domain spline.inf.fu-berlin.de from the output and you will get only the hostnames. --- contrib/bash-completion | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/bash-completion b/contrib/bash-completion index 1adad22..0994d39 100644 --- a/contrib/bash-completion +++ b/contrib/bash-completion @@ -1,7 +1,5 @@ # hostinfo completion -_hostinfo_hosts="$(for file in /usr/local/share/hostinfo/* ; do basename $file | sed 's/.spline.inf.fu-berlin.de//' ; done)" - _get_first_hostinfo_arg() { local i @@ -30,6 +28,7 @@ _get_hostinfo_path() done } + _hostinfo() { local cur prev @@ -43,7 +42,7 @@ _hostinfo() { _get_first_hostinfo_arg _get_hostinfo_path if [[ -z "$arg" ]]; then - _completion="$_hostinfo_hosts" + _completion="$(hostinfo $path --hosts --short 2>/dev/null)" else _completion="$(hostinfo $path --keys $arg 2>/dev/null)" fi -- cgit v1.2.3-1-g7c22