On Fri, Jul 25, 2008 at 10:27 PM, David Lutterkort <[EMAIL PROTECTED]>wrote:

> On Thu, 2008-07-24 at 17:04 +0200, [EMAIL PROTECTED] wrote:
> > # HG changeset patch
> > # User Raphael Pinson <[EMAIL PROTECTED]>
> > # Date 1216911887 -7200
> > # Node ID 26d9cf6f08a155818cab92eb1275a932a017d19b
> > # Parent  ae394e5c16338ed8622274199c4ad5900fff20b8
> > Add bash_completion script for augtool
>
> Nice.
>
> > diff -r ae394e5c1633 -r 26d9cf6f08a1 augeas.bash_completion
> > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> > +++ b/augeas.bash_completion  Thu Jul 24 17:04:47 2008 +0200
>
> > +              case $cur in
> > +                 /augeas*)
> > +                       files=$( find ${rootdir}/${cur##/augeas}*
>  -maxdepth 1 2>/dev/null | sed -e "[EMAIL PROTECTED]@/[EMAIL PROTECTED]" | 
> sed -re "s@/+@/@g"
> )
> > +                    COMPREPLY=( $( compgen -W "${files}" -- $cur ) )
> > +                    ;;
> > +                 /files*)
> > +                       files=$( find ${rootdir}/${cur##/files}*
>  -maxdepth 1 2>/dev/null | sed -e "[EMAIL PROTECTED]@/[EMAIL PROTECTED]" | 
> sed -re "s@/+@/@g"
> )
> > +                    COMPREPLY=( $( compgen -W "${files}" -- "$cur" ) )
> > +                    ;;
>
> This doesn't seem right to me .. why do you look into the filesystem for
> possible completions ? Shouldn't you complete on the output of 'augtool
> ls $cur' ?
>

That's what I would do indeed, if augtool was reactive enough. Since augtool
takes at least 3 secondes on each request (it's not even an issue with my
machine, since I develop on a dual-core amd64 with 4GB RAM server), I
thought I would just use the filesystem to complete instead of augtool
itself.




Raphael
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to