[Lunar-commits] CVS: moonbase/utils/theedge/profile.d theedge.rc,
1.2, 1.3
Chad Kittel
v3rt1g0 at lunar-linux.org
Sun Sep 26 04:14:03 UTC 2004
Update of /var/cvs/lunar/moonbase/utils/theedge/profile.d
In directory espresso.foo-projects.org:/tmp/cvs-serv6019
Modified Files:
theedge.rc
Log Message:
Syncing lvu's tab completion with valid sub-commands. This commit partly
resolves issue #356 (which is now just waiting on an update to lvu's man
page). Also made the tab complete a bit "smarter" when it comes to
sub-commands that do not take a module name (like 'lvu leafs')
Index: theedge.rc
===================================================================
RCS file: /var/cvs/lunar/moonbase/utils/theedge/profile.d/theedge.rc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- theedge.rc 19 Apr 2004 10:52:04 -0000 1.2
+++ theedge.rc 26 Sep 2004 04:14:01 -0000 1.3
@@ -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"
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 depends tree eert stree leert held exiled urls versions short' $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