From b9527aabb93b48f2fa2ab14a7b7678bb0ba49369 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Thu, 9 Jul 2015 21:06:12 +0100 Subject: vyatta-cfg: updated fix for formatting top level cli merge command Update to the earlier fix for the formatting issue with the merge command when listing the available commands at the top level CLI. The previous commit caused formatting issues with node level commands, purely aesthetic. Bug #509 http://bugzilla.vyos.net/show_bug.cgi?id=509 --- etc/bash_completion.d/vyatta-cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index c87e4d9..0e4b7f8 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -460,6 +460,7 @@ get_help_text () vyatta_help_text="\\nPossible completions:" local print_node_type=$1 local editlvl=$(cli-shell-api getEditLevelStr) + local node=0; for (( idx = 0; idx < ${#_get_help_text_items[@]}; idx++ )); do vyatta_help_text+="\\n" if (( ${#COMP_WORDS[@]} < 2 )) || @@ -474,11 +475,12 @@ get_help_text () multi) vyatta_help_text+="+ " ;; *) vyatta_help_text+=" " ;; esac + node=1; else vyatta_help_text+="\\x20\\x20" fi fi - if [ ${#_get_help_text_items[idx]} -lt 6 ]; then + if [ ${#_get_help_text_items[idx]} -lt $((6 - $node)) ]; then vyatta_help_text+="${_get_help_text_items[idx]}\\t\\t" elif [ ${#_get_help_text_items[idx]} -lt 13 ]; then vyatta_help_text+="${_get_help_text_items[idx]}\\t" -- cgit v1.2.3