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

Guillaume Rousse guillomovitch at zarb.org
Sun May 17 20:13:20 UTC 2009


The following commit has been merged in the master branch:
commit 996c9c20348897b8ef170928cfd1ee1e45aceda7
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date:   Sun May 17 22:00:32 2009 +0200

    split mc completion

diff --git a/bash_completion b/bash_completion
index a14c584..0967cff 100644
--- a/bash_completion
+++ b/bash_completion
@@ -6170,49 +6170,6 @@ _mkisofs()
 } &&
 complete -F _mkisofs $filenames mkisofs genisoimage
 
-# mc(1) completion
-#
-have mc &&
-_mc()
-{
-	local cur prev
-
-	COMPREPLY=()
-	cur=`_get_cword`
-	prev=${COMP_WORDS[COMP_CWORD-1]}
-
-	# -name value style option
-	case "$prev" in
-		-@(e|v|l|P))
-			_filedir
-			return 0
-			;;
-	esac
-
-	# --name=value style option
-	if [[ "$cur" == *=* ]]; then
-		prev=${cur/=*/}
-		cur=${cur/*=/}
-		case "$prev" in
-			--@(edit|view|ftplog|printwd))
-				_filedir
-				return 0
-				;;
-		esac
-	fi
-
-	if [[ "$cur" == -* ]]; then
-		COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \
-			--color -C --colors= -d --nomouse -e --edit= -f \
-			--datadir -k --resetsoft -l --ftplog= -P --printwd= \
-			-s --slow -t --termcap -u --nosubshell -U --subshell \
-			-v --view= -V --version -x --xterm -h --help' -- $cur ) )
-	else
-		_filedir -d
-	fi
-} &&
-complete -F _mc $filenames mc
-
 # ImageMagick completion
 #
 have convert && {
diff --git a/contrib/mc b/contrib/mc
new file mode 100644
index 0000000..4c9fc2d
--- /dev/null
+++ b/contrib/mc
@@ -0,0 +1,45 @@
+# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+# ex: ts=8 sw=8 noet filetype=sh
+#
+# bash completion for mc
+
+have mc &&
+_mc()
+{
+	local cur prev
+
+	COMPREPLY=()
+	cur=`_get_cword`
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+
+	# -name value style option
+	case "$prev" in
+		-@(e|v|l|P))
+			_filedir
+			return 0
+			;;
+	esac
+
+	# --name=value style option
+	if [[ "$cur" == *=* ]]; then
+		prev=${cur/=*/}
+		cur=${cur/*=/}
+		case "$prev" in
+			--@(edit|view|ftplog|printwd))
+				_filedir
+				return 0
+				;;
+		esac
+	fi
+
+	if [[ "$cur" == -* ]]; then
+		COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \
+			--color -C --colors= -d --nomouse -e --edit= -f \
+			--datadir -k --resetsoft -l --ftplog= -P --printwd= \
+			-s --slow -t --termcap -u --nosubshell -U --subshell \
+			-v --view= -V --version -x --xterm -h --help' -- $cur ) )
+	else
+		_filedir -d
+	fi
+} &&
+complete -F _mc $filenames mc

-- 
bash-completion



More information about the Bash-completion-commits mailing list