diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-15 11:04:50 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-15 11:04:50 -0800 |
commit | b923701d4c096613c104396425bcc4ea428870b6 (patch) | |
tree | 73fa15390b27f3e0a8e15dd5be8fabbb61b669be /etc | |
parent | 89e34ff4610413091c0311c9c1ec56a3afce3ef2 (diff) | |
download | vyatta-op-b923701d4c096613c104396425bcc4ea428870b6.tar.gz vyatta-op-b923701d4c096613c104396425bcc4ea428870b6.zip |
allow "root-level" completion/help
Diffstat (limited to 'etc')
-rw-r--r-- | etc/bash_completion.d/10vyatta-op | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index 957c8b6..5b74d93 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -43,6 +43,8 @@ _vyatta_op_debug () _vyatta_op_init () { + complete -F _vyatta_op_expand '' + for xd in $vyatta_op_templates/* ; do if [ -d $xd ] ; then cmd=${xd##*/} @@ -160,7 +162,12 @@ _vyatta_op_compreply () _vyatta_op_expand () { - local cur=${COMP_WORDS[COMP_CWORD]} + local cur="" + if (( ${#COMP_WORDS[@]} > 0 )); then + cur=${COMP_WORDS[COMP_CWORD]} + else + (( COMP_CWORD = ${#COMP_WORDS[@]} )) + fi local node_path=$vyatta_op_templates local -a comps local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; ) |