From 8cfd8e1f4e5aa27fb5386ad4bd295ac683c7f7be Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 4 Oct 2011 19:20:50 -0500 Subject: warn user of invalid top level command, this will tell the user when the try to complete on a non-vyatta command, after hitting space, normal completion will continue to work for non-vyatta commands --- etc/bash_completion.d/vyatta-cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 787a363..716e216 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -730,6 +730,9 @@ vyatta_config_complete () fi get_help_text vyatta_completions=( "${_get_help_text_items[@]}" ) + if [[ ${#vyatta_completions[@]} -eq 0 ]]; then + vyatta_help_text="\n\n Invalid command: [${COMP_WORDS[COMP_CWORD]}]" + fi vyatta_do_complete eval $restore_shopts return -- cgit v1.2.3