Package: bash Version: 2.05b-15 Severity: normal Since sudo and all the other functions that become meta commandlines in themselve all accept switches,we should pass over them:
--- /tmp/metacomplete 2005-01-11 22:02:03.000000000 +1100 +++ /etc/bash_completion.d/metacomplete 2005-01-11 22:05:35.000000000 +1100 @@ -10,7 +10,20 @@ COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} +#if the the first arguments following our meta-command-invoker are switches, get rid of them. Most definitely not foolproof. + done= + while [ -z $done ] ; do cmd=${COMP_WORDS[1]} + if [[ "$cmd" == -* ]] ; then + for (( i=1 ; i<=COMP_CWORD ; i++)) ; do +# echo i=$i + COMP_WORDS[i]=${COMP_WORDS[i+1]} + done + COMP_CWORD=$(($COMP_CWORD-1)) + else + done=1 + fi + done if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -c -- $cur ) ) @@ -23,8 +36,6 @@ # so we can set them before handing off to regular # completion routine - # set current token number to 1 less than now - COMP_CWORD=$(( $COMP_CWORD - 1 )) # get function name func=${cspec#*-F } func=${func%% *} @@ -66,7 +77,7 @@ [ [EMAIL PROTECTED] -eq 0 ] && _filedir } complete -F _command $filenames nohup exec nice eval strace time ltrace then \ - else do vsound command + else do vsound command xargs _root_command() { also added xargs to list of commands that can use metacomplete -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.4.26 Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1) Versions of packages bash depends on: ii base-files 3.1.2 Debian base system miscellaneous f ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an ii libncurses5 5.4-4 Shared libraries for terminal hand -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]