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 16:44:44 -0500
commit275541f60ef4ff9b86519d1d6a59e1d4841a3358 (patch)
tree7612f022e8c5d97d258f14fdb4a7775e872b38f1 /etc
parentfc0e4507f0b9a6ea8bb50642ac79962b6ea20ecd (diff)
downloadvyatta-op-275541f60ef4ff9b86519d1d6a59e1d4841a3358.tar.gz
vyatta-op-275541f60ef4ff9b86519d1d6a59e1d4841a3358.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