Issue with bash completion

suvayu ali fatkasuvayu+linux at gmail.com
Thu May 31 12:29:15 UTC 2012


Hello Ed,

On Thu, May 31, 2012 at 2:05 PM, Ed Greshko <Ed.Greshko at greshko.com> wrote:
> Hummm......
>
> You said you did an upgrade.  The difference between your system and mine is that
> mine is a fresh install.
>
> In F16 the _find function is in /etc/bash_completion.d/findutils  while in F17 it is
> in /usr/share/bash-completion/completions/find  as you've noted.
>
> I wonder if you did the same under a newly defined user if you'd have the problem as
> it seems to be related to an upgrade.

I have the same problem with a new user too. However I noticed something
interesting. The following is a session demonstrating it.

  $ function find_ext() { echo "dummy fn"; }
  $ complete -F _find find_ext
  $ complete -p find_ext
  complete -F _find find_ext
  $ complete -p find
  -bash: complete: find: no completion specification
  $ find_ext [TAB] -bash: completion: function `_find' not found

However, if now I try to complete for find, it works.

  $ find -t [TAB] [TAB]
  -true  -type

This somehow loads the completion functions dynamically

  $ complete -p find
  complete -F _find find

And now I can complete with my wrapper function!

  $ find_ext -t [TAB] [TAB]
  -true  -type

I guess that means I have to figure out how this dynamic loading works
and I have to change my "complete -F <completion_fn> <wrapper>" calls
accordingly.

Thanks a lot for the help and discussion. :)

-- 
Suvayu

Open source is the future. It sets us free.


More information about the users mailing list