From f8f731e3edef30bf9e094a2112352b660e095e50 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Wed, 3 May 2017 15:27:38 +0400 Subject: [PATCH] =?UTF-8?q?support=20de=20la=20compl=C3=A9tion=20pour=20rw?= =?UTF-8?q?oinst=20-w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/completion.d/nutools | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/completion.d/nutools b/lib/completion.d/nutools index f52a598..381a4f2 100644 --- a/lib/completion.d/nutools +++ b/lib/completion.d/nutools @@ -1,13 +1,21 @@ # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 function __nutools_host_completion() { - local cur prev - _get_comp_words_by_ref cur prev - if [ "$prev" == "-h" -o "$prev" == "-H" ]; then + local cur prev; _get_comp_words_by_ref cur prev + [ "$prev" == "-h" -o "$prev" == "-H" -o "$prev" == "--host" ] && _known_hosts_real "$cur" + return 0 +} +function __nutools_whost_completion() { + local cur prev; _get_comp_words_by_ref cur prev + if [ "$prev" == "-h" -o "$prev" == "-H" -o "$prev" == "--host" ]; then + _known_hosts_real "$cur" + elif [ "$prev" == "-w" -o "$prev" == "--whost" ]; then _known_hosts_real "$cur" fi + return 0 } complete -F __nutools_host_completion -o default uinst ruinst runs rruns rwoinst rtoinst +complete -F __nutools_whost_completion -o default rwoinst if __bash_completion_module_enabled ssh; then shopt -u hostcomplete