- simplify _root_command() and actually install it for use by sudo
This commit is contained in:
parent
7431c79c22
commit
59f672285f
@ -1,6 +1,6 @@
|
||||
# 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>
|
||||
#
|
||||
@ -1421,17 +1421,13 @@ _command()
|
||||
COMPREPLY=( $( compgen -f -- $cur ) )
|
||||
fi
|
||||
}
|
||||
complete -F _command -o filenames nohup exec nice eval strace sudo
|
||||
complete -F _command -o filenames nohup exec nice eval strace
|
||||
|
||||
_root_command()
|
||||
{
|
||||
local OLDPATH=$PATH
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
||||
_command
|
||||
PATH=$OLDPATH
|
||||
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command
|
||||
}
|
||||
complete -F _command -o filenames sudo
|
||||
complete -F _root_command -o filenames sudo
|
||||
|
||||
# Perforce completion by Frank Cusack (frank@google.com)
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user