From b7b2c23f7a4fda74678ede927882694248425c1f Mon Sep 17 00:00:00 2001 From: John Southworth Date: Fri, 30 Sep 2011 16:44:44 -0500 Subject: Add some useful debugging to the comps script, it can be enabled on the fly via an environment variable --- etc/bash_completion.d/vyatta-op | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'etc') diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index d9d7141..87ee5bc 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -367,6 +367,14 @@ _vyatta_op_expand () fi done fi + # Set this environment to enable and disable debugging on the fly + if [[ $DBG_OP_COMPS -eq 1 ]]; then + echo "Current: $cur" + echo "Number of comps: ${#_vyatta_op_completions[@]}" + echo "Number of non-comps: ${#_vyatta_op_noncompletions[@]}" + echo "Last comp: $_vyatta_op_last_comp" + echo -e "Cureent comp: ${COMP_WORDS[*]}\n" + fi # if there are no completions then handle invalid commands if [ ${#_vyatta_op_noncompletions[@]} -eq 0 ] && [ ${#_vyatta_op_completions[@]} -eq 0 ]; then -- cgit v1.2.3