- simplify _root_command() and actually install it for use by sudo

This commit is contained in:
ianmacd 2002-02-27 08:55:30 +00:00
parent 7431c79c22
commit 59f672285f

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a # bash_completion - some programmable completion functions for bash 2.05a
# #
# $Id: bash_completion,v 1.157 2002/02/27 07:47:09 ianmacd Exp $ # $Id: bash_completion,v 1.158 2002/02/27 09:55:30 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -1421,17 +1421,13 @@ _command()
COMPREPLY=( $( compgen -f -- $cur ) ) COMPREPLY=( $( compgen -f -- $cur ) )
fi fi
} }
complete -F _command -o filenames nohup exec nice eval strace sudo complete -F _command -o filenames nohup exec nice eval strace
_root_command() _root_command()
{ {
local OLDPATH=$PATH PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
_command
PATH=$OLDPATH
} }
complete -F _command -o filenames sudo complete -F _root_command -o filenames sudo
# Perforce completion by Frank Cusack (frank@google.com) # Perforce completion by Frank Cusack (frank@google.com)
# #