From dc2636371204f906b5d4de70e8ee0b980d539656 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 16 Feb 2010 14:17:46 -0800 Subject: Add completion for loadkey --- etc/bash_completion.d/20vyatta-cfg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 03cfe6c..efe1fb4 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -434,7 +434,11 @@ loadkey() vyatta_loadkey_complete() { case "$COMP_CWORD" in - 1) COMPREPLY=( $( compgen -u -- ${COMP_WORDS[1]} ) ) ;; + 1) if [ -z "${COMP_WORDS[1]}" ]; then + COMPREPLY=( $(getent passwd | awk -F: '$7 == "/bin/vbash" { print $1}') ) + else + COMPREPLY=( $(compgen -u -- ${COMP_WORDS[1]} ) ) + fi ;; 2) if [ -z "${COMP_WORDS[2]}" ]; then echo "Possible completions:" echo -e " \t\t\t\tLoad from file on local machine" @@ -929,6 +933,7 @@ vyatta_config_complete () "edit" \ "exit" \ "load" \ + "loadkey" \ "merge" \ "rename" \ "run" \ -- cgit v1.2.3