From 06261d5640c760b33d4b3841d76e3e86009b6f86 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 7 Nov 2007 15:46:46 -0800 Subject: add '' to help text if the current command line is a valid command. --- etc/bash_completion.d/10vyatta-op | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'etc/bash_completion.d') 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 '' "Execute the current command" + fi for comp ; do if [ -z "$comp" ] ; then _vyatta_op_print_help '*' "$node_tag_help" -- cgit v1.2.3