summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-04 17:59:03 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-10-04 17:59:03 -0500
commitc537b754c5f37278054c4248b735aa9cf347a428 (patch)
tree8cb77416d7efcd94f3362e8b06e0ee81dd779e25
parent6d554ab766762389baf602bcf0991290aa12cdc4 (diff)
downloadvyatta-cfg-c537b754c5f37278054c4248b735aa9cf347a428.tar.gz
vyatta-cfg-c537b754c5f37278054c4248b735aa9cf347a428.zip
Fix some help text, add discard and confirm completion functions, fix comment completion validation
-rwxr-xr-xetc/bash_completion.d/vyatta-cfg13
-rw-r--r--functions/interpreter/vyatta-cfg-run2
2 files changed, 9 insertions, 6 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg
index 5750f68..213dad9 100755
--- a/etc/bash_completion.d/vyatta-cfg
+++ b/etc/bash_completion.d/vyatta-cfg
@@ -325,7 +325,7 @@ vyatta_compare_complete ()
if [ $COMP_CWORD -eq 1 -a -z "${COMP_WORDS[1]}" ]; then
echo
echo "Possible completions:"
- echo -e " <enter>\tCompare working & active configurations"
+ echo -e " <Enter>\tCompare working & active configurations"
echo -e " saved\t\tCompare working & saved configurations"
echo -e " <N>\t\tCompare working with revision N"
echo -e " <N> <M>\tCompare revision N with M"
@@ -335,14 +335,14 @@ vyatta_compare_complete ()
elif [ $COMP_CWORD -eq 2 -a -z "${COMP_WORDS[2]}" ]; then
if [[ "${COMP_WORDS[1]}" == "saved" ]]; then
echo "Possible completions:"
- echo -e " <enter>\tCompare working and saved configurations"
+ echo -e " <Enter>\tCompare working and saved configurations"
COMPREPLY=( "" " " )
eval $restore_shopts
return
fi
echo
echo "Possible completions:"
- echo -e " <enter>\tCompare working revision N"
+ echo -e " <Enter>\tCompare working revision N"
echo -e " <M>\t\tCompare revision N with M"
echo -e "\n Revisions:"
print_commit_log
@@ -377,9 +377,9 @@ vyatta_commit_complete ()
echo
echo "Possible completions:"
if [ "${COMP_WORDS[0]}" = "commit" ]; then
- echo -e " <enter>\tCommit working configuration"
+ echo -e " <Enter>\tCommit working configuration"
elif [ "${COMP_WORDS[0]}" = "commit-confirm" ]; then
- echo -e " <enter>\tCommit, rollback/reboot in 10 minutes if no confirm"
+ echo -e " <Enter>\tCommit, rollback/reboot in 10 minutes if no confirm"
echo -e " <N>\t\tCommit, rollback/reboot in N minutes if no confirm"
fi
echo -e " comment\tComment for commit log"
@@ -635,6 +635,9 @@ vyatta_config_invalid_comp ()
if [[ $validateret -eq 0 ]]; then
echo -en "\nPossible completions:\n"
echo -en " <Enter>\tExecute the current command"
+ elif [[ "$cmd" == "comment" ]];then
+ echo -en "\nPossible completions:\n"
+ echo -en " <Enter>\tExecute the current command"
else
# find broken portion of command
for arg in "${expanded_api_args[@]:1}"; do
diff --git a/functions/interpreter/vyatta-cfg-run b/functions/interpreter/vyatta-cfg-run
index f7b109c..9c01194 100644
--- a/functions/interpreter/vyatta-cfg-run
+++ b/functions/interpreter/vyatta-cfg-run
@@ -576,7 +576,7 @@ _vyatta_cfg_init ()
save|load|merge)
complete -F vyatta_loadsave_complete ${cmd:0:$pos} ;;
discard|confirm)
- ;;
+ complete -F vyatta_single_word_complete ${cmd:0:$pos} ;;
run)
complete -F vyatta_run_complete ${cmd:0:$pos} ;;
loadkey)