[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 47fb2d8f0e3382c7b3512c5f38c9cfc6b9f7f615

Ville Skyttä ville.skytta at iki.fi
Fri Sep 4 21:28:06 UTC 2009


The following commit has been merged in the master branch:
commit 47fb2d8f0e3382c7b3512c5f38c9cfc6b9f7f615
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Sep 5 00:26:48 2009 +0300

    Revert "Improve sudo completion (Alioth: #311414)."
    
    This reverts commit 11d4d978876ceb58eaec5dcfd82fae7b9699acfd.
    Avoiding breaking completion for the sudo'd command isn't as
    straightforward as I thought.

diff --git a/CHANGES b/CHANGES
index 8d61706..6d8b523 100644
--- a/CHANGES
+++ b/CHANGES
@@ -105,7 +105,6 @@ bash-completion (1.x)
     and zmore filename completions.
   * Add xz and compress support and more tarball filename extensions to
     rpmbuild -t*/--tarbuild completion.
-  * Improve sudo completion (Alioth: #311414).
 
   [ Todd Zullinger ]
   * Make yum complete on filenames after install, deplist, update and upgrade
diff --git a/Makefile.am b/Makefile.am
index e26f0a5..d903632 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -121,7 +121,6 @@ bashcomp_DATA = contrib/ant \
 		contrib/snownews \
 		contrib/ssh \
 		contrib/strace \
-		contrib/sudo \
 		contrib/svk \
 		contrib/sysctl \
 		contrib/sysv-rc \
diff --git a/bash_completion b/bash_completion
index c7640c5..93ef65a 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1387,7 +1387,7 @@ _root_command()
 {
 	PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3
 }
-complete -F _root_command $filenames fakeroot really gksudo gksu kdesudo
+complete -F _root_command $filenames sudo fakeroot really gksudo gksu kdesudo
 
 _longopt()
 {
diff --git a/contrib/sudo b/contrib/sudo
deleted file mode 100644
index fd35932..0000000
--- a/contrib/sudo
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
-# ex: ts=8 sw=8 noet filetype=sh
-#
-# bash completion for sudo
-
-have sudo &&
-_sudo()
-{
-	local cur prev
-
-	COMPREPLY=()
-	cur=`_get_cword`
-	prev=${COMP_WORDS[COMP_CWORD-1]}
-
-	# TODO: more option completions
-
-	case $prev in
-		-e)
-			_filedir
-			return 0
-			;;
-		-u)
-			COMPREPLY=( $( compgen -u -- $cur ) )
-			return 0
-			;;
-	esac
-
-	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-e -u' -- $cur ) )
-		return 0
-	fi
-
-	_root_command $1 $2 $3
-} &&
-complete -F _sudo $filenames sudo

-- 
bash-completion



More information about the Bash-completion-commits mailing list