summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-07-09 21:06:12 +0100
committerDaniil Baturin <daniil@baturin.org>2015-08-12 03:49:06 +0200
commit3c72d8fcc854c8731db0c94e7daeddfe90fbf967 (patch)
treefb51ccea905435140c9e0f78aa838ef27e123f2a
parent381520719740135236f8a827d14f3c91e6b3ac41 (diff)
downloadvyatta-cfg-3c72d8fcc854c8731db0c94e7daeddfe90fbf967.tar.gz
vyatta-cfg-3c72d8fcc854c8731db0c94e7daeddfe90fbf967.zip
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
-rwxr-xr-xetc/bash_completion.d/vyatta-cfg4
1 files changed, 3 insertions, 1 deletions
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"