summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-09-30 16:44:44 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-09-30 17:09:50 -0500
commitb7b2c23f7a4fda74678ede927882694248425c1f (patch)
tree4a0dd14d227f470fc89a39217afabea5e2325911 /etc
parent1824fff85436a826f53e9ec07a3e07376b2101be (diff)
downloadvyatta-op-b7b2c23f7a4fda74678ede927882694248425c1f.tar.gz
vyatta-op-b7b2c23f7a4fda74678ede927882694248425c1f.zip
Add some useful debugging to the comps script, it can be enabled on the fly via an environment variable
Diffstat (limited to 'etc')
-rw-r--r--etc/bash_completion.d/vyatta-op8
1 files changed, 8 insertions, 0 deletions
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