[Lunar-commits] r21958 - moonbase/trunk/utils/lunar/profile.d

Chad Kittel v3rt1g0 at lunar-linux.org
Thu Oct 26 19:20:46 CEST 2006


Author: v3rt1g0
Date: 2006-10-26 19:20:45 +0200 (Thu, 26 Oct 2006)
New Revision: 21958

Modified:
   moonbase/trunk/utils/lunar/profile.d/lunar.rc
Log:
Update lunar's tab completion to be as compelete as theedge's


Modified: moonbase/trunk/utils/lunar/profile.d/lunar.rc
===================================================================
--- moonbase/trunk/utils/lunar/profile.d/lunar.rc	2006-10-26 16:16:17 UTC (rev 21957)
+++ moonbase/trunk/utils/lunar/profile.d/lunar.rc	2006-10-26 17:20:45 UTC (rev 21958)
@@ -20,16 +20,23 @@
 
 _lvu ()
 {
+	# List any lvu sub-commands that do not take a module name 
+	# after it
+        LVU_CMDS_WITH_NO_MODULE="leafs orphans alien held exiled export moonbase html updatelog activity pam expired"
 	local cur prev
 	COMPREPLY=()
 	cur=${COMP_WORDS[COMP_CWORD]}
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
 	if [ $COMP_CWORD -eq 1 ] || [ "${prev:0:1}" = "-" ]; then
-		COMPREPLY=( $( compgen -W 'DETAILS DEPENDS CONFLICTS BUILD PRE_BUILD POST_BUILD CONFIGURE POST_INSTALL PRE_REMOVE POST_REMOVE what where cd alien from leafs orphans search service website install size installed compile compiler links sources maintainer version sum md5sum export import section moonbase html updatelog activity newer older prune voyeur pam depends tree eert stree leert' $cur ))
+		COMPREPLY=( $( compgen -W 'DETAILS DEPENDS CONFLICTS BUILD PRE_BUILD POST_BUILD CONFIGURE POST_INSTALL PRE_REMOVE POST_REMOVE what where cd alien from leafs orphans search service website install size installed compile compiler links sources maintainer version sum md5sum export import section moonbase html updatelog activity newer older voyeur pam expired depends tree eert stree leert held exiled urls versions short info' $cur ))
 	elif [ $COMP_CWORD -eq 2 -a $prev = "from" ]; then
 	        COMPREPLY=( $(compgen -f "$cur") )
 	elif [ $COMP_CWORD -eq 2 ]; then
+		# Bail out if we don't need a third param
+		for CMD in $LVU_CMDS_WITH_NO_MODULE; do
+			if [ "$prev" = "$CMD" ]; then return 0; fi
+		done
 		COMPREPLY=( $( compgen -W "`cat /var/state/lunar/module.index | cut -d: -f1`" $cur ))
 	fi
 	return 0



More information about the Lunar-commits mailing list