From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=DMARC_NONE,MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=no autolearn_force=no version=4.0.0 Received: from lark.theleaf.office (cable-213-132-142-63.upc.chello.be [213.132.142.63]) by chiba.3jane.net (Postfix) with SMTP id ACB5D239B5 for ; Fri, 14 Dec 2001 05:32:41 -0600 (CST) Received: (qmail 11339 invoked from network); 14 Dec 2001 11:33:02 -0000 Received: from unknown (HELO willow.theleaf.office) (10.1.1.3) by 10.1.1.1 with SMTP; 14 Dec 2001 11:33:02 -0000 From: Geert Bevin To: gentoo-dev@gentoo.org Content-Type: multipart/mixed; boundary="=-F34v3i8NvDVZtBEWIy4Z" X-Mailer: Evolution/1.0 (Preview Release) Date: 14 Dec 2001 12:32:06 +0100 Message-Id: <1008329526.5410.4.camel@willow.theleaf.office> Mime-Version: 1.0 Subject: [gentoo-dev] emerge, ebuild and rc-update bash completion Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk Reply-To: gentoo-dev@gentoo.org List-Help: List-Post: List-Subscribe: , List-Id: Developer discussion list List-Unsubscribe: , List-Archive: X-Archives-Salt: 11a0c78d-7f89-4f85-9a7b-7438c7c4e975 X-Archives-Hash: 29239dd1b0a6c07b75042ad2f1a70fd5 --=-F34v3i8NvDVZtBEWIy4Z Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi all, added the completions for ebuild and rc-update, and made the completion for emerge quite a bit faster. Enjoy ! Geert -- Geert Bevin the Leaf sprl/bvba "Use what you need" Pierre Theunisstraat 1/47 http://www.theleaf.be 1030 Brussels gbevin@theleaf.be Tel & Fax +32 2 241 19 98 --=-F34v3i8NvDVZtBEWIy4Z Content-Disposition: attachment; filename=gentoo.completion Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1 # Gentoo linux command completion. # _emerge() { local cur prev grepcmd sedcmd systemactions setsma setbig portagedir portagedir=3D/usr/portage COMPREPLY=3D() cur=3D${COMP_WORDS[COMP_CWORD]} prev=3D${COMP_WORDS[COMP_CWORD-1]} if [ $COMP_CWORD -eq 1 ] && [[ "$cur" =3D=3D -* ]]; then COMPREPLY=3D( $( compgen -W '--pretend \ --autoclean \ --usepkg \ --buildpkg' | grep ^$cur ) ) elif [ "$prev" =3D=3D "--usepkg" ]; then COMPREPLY=3D( $( compgen -f $cur ) ) else cd ${portagedir} grepcmd=3D"grep -E ^$cur.*" sedcmd=3D"sed -e /CVS/d \ -e /BUGS-TODO/d \ -e /ChangeLog.*/d \ -e /header.txt/d \ -e /skel.build/d \ -e /distfiles/d \ -e /eclass/d \ -e /files/d \ -e /incoming/d \ -e /packages/d \ -e /profiles/d \ -e /scripts/d" systemactions=3D$'\n'"system"$'\n'"update" if [ $cur ]; then if [ `echo $cur | grep '/'` ]; then setbig=3D"`compgen -G "$cur*" | $sedcmd`"$systemactions COMPREPLY=3D( $( echo "$setbig" | $grepcmd ) ) else setsma=3D"`compgen -S '/' -G "$cur*" | $sedcmd`"$systemactions if [ `echo "$setsma" | $grepcmd | grep '/' | wc -l` =3D 1 ]; then setbig=3D"`compgen -G "*/*" | $sedcmd`"$systemactions COMPREPLY=3D( $( echo "$setbig" | $grepcmd ) ) else COMPREPLY=3D( $( echo "$setsma" | $grepcmd ) ) fi fi else setsma=3D"`compgen -S '/' -G "$cur*" | $sedcmd`"$systemactions COMPREPLY=3D( $( echo "$setsma" ) ) fi fi =09 return 0 } complete -F _emerge emerge _ebuild() { local cur prev COMPREPLY=3D() cur=3D${COMP_WORDS[COMP_CWORD]} prev=3D${COMP_WORDS[COMP_CWORD-1]} =09 if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=3D( $( compgen -f $cur ) ) elif [ $COMP_CWORD -eq 2 ]; then COMPREPLY=3D( $( compgen -W 'clean \ compile \ fetch \ install \ merge \ package \ qmerge \ remerge \ rpm \ unmerge \ unpack' $cur ) ) fi return 0 } complete -F _ebuild ebuild _rc-update() { local cur prev initdir runlvdir initdir=3D/etc/init.d/ runlvdir=3D/etc/runlevels/ COMPREPLY=3D() cur=3D${COMP_WORDS[COMP_CWORD]} prev=3D${COMP_WORDS[COMP_CWORD-1]} =09 if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=3D( $( compgen -W 'add del' $cur ) ) elif [ $COMP_CWORD -eq 2 ]; then cd $initdir COMPREPLY=3D( $( compgen -G "$cur*" ) ) elif [ $COMP_CWORD -eq 3 ]; then cd $runlvdir COMPREPLY=3D( $( compgen -G "$cur*" ) ) fi return 0 } complete -F _rc-update rc-update --=-F34v3i8NvDVZtBEWIy4Z--