summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 15:46:46 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 15:46:46 -0800
commit06261d5640c760b33d4b3841d76e3e86009b6f86 (patch)
tree3aa51314c22c6c176dcd077f9848f9d0af570a67 /etc
parent62b07a426534c9579d409e3fcd51847eb4e3c670 (diff)
downloadvyatta-op-06261d5640c760b33d4b3841d76e3e86009b6f86.tar.gz
vyatta-op-06261d5640c760b33d4b3841d76e3e86009b6f86.zip
add '<Enter>' to help text if the current command line is a valid command.
Diffstat (limited to 'etc')
-rw-r--r--etc/bash_completion.d/10vyatta-op9
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op
index 9da12aa..d9606ea 100644
--- a/etc/bash_completion.d/10vyatta-op
+++ b/etc/bash_completion.d/10vyatta-op
@@ -97,13 +97,20 @@ _vyatta_op_help ()
{
local cur=$1; shift
local node_path=$1; shift
- local ndef node_tag_help help
+ local ndef node_tag_help node_run help
ndef=$node_path/node.tag/node.def
[ -f $ndef ] && \
node_tag_help=$( _vyatta_op_get_node_def_field $ndef help )
+ ndef=$node_path/node.def
+ [ -f $ndef ] && \
+ node_run=$( _vyatta_op_get_node_def_field $ndef run )
+
echo -en "\nPossible completions:"
+ if [ -z "$cur" -a -n "$node_run" ]; then
+ _vyatta_op_print_help '<Enter>' "Execute the current command"
+ fi
for comp ; do
if [ -z "$comp" ] ; then
_vyatta_op_print_help '*' "$node_tag_help"