diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-10-04 19:20:50 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-10-04 19:20:50 -0500 |
commit | 8cfd8e1f4e5aa27fb5386ad4bd295ac683c7f7be (patch) | |
tree | 6895e96981f74b0042048e1e72a27ac2a807b4b9 /etc | |
parent | 1c06020ceaf3525eb084c1bac571085352a37c0f (diff) | |
download | vyatta-cfg-8cfd8e1f4e5aa27fb5386ad4bd295ac683c7f7be.tar.gz vyatta-cfg-8cfd8e1f4e5aa27fb5386ad4bd295ac683c7f7be.zip |
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
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/bash_completion.d/vyatta-cfg | 3 |
1 files changed, 3 insertions, 0 deletions
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 |