diff --git a/bash_completion b/bash_completion index ef52f124..4ec8bb9b 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05a # -# $Id: bash_completion,v 1.235 2002/03/29 16:33:08 ianmacd Exp $ +# $Id: bash_completion,v 1.236 2002/03/30 19:20:51 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -1737,6 +1737,15 @@ _command() # split current command line tokens into array COMP_WORDS=( $cline ) $func $cline + # remove any \: generated by a command that doesn't + # default to filenames or dirnames (e.g. sudo chown) + if [ "${cspec#*-o }" != "$cspec" ]; then + cspec=${cspec#*-o } + cspec=${cspec%% *} + if [[ "$cspec" != @(dir|file)names ]]; then + COMPREPLY=( "${COMPREPLY[@]//\\\\:/:}" ) + fi + fi elif [ "${cspec#*-[abcdefgjkvu]}" != "$cspec" ]; then # complete -[abcdefgjkvu] func=$( echo $cspec | \