[Bash-completion-devel] [PATCHES] review some patches from Mandriva

Guillaume Rousse Guillaume.Rousse at inria.fr
Tue Jan 13 09:08:11 UTC 2009


Le mardi 13 janvier 2009 à 09:39 +0100, Santiago M. Mola a écrit :
> > Apart those global change, I also have simpler patches easy to
> > review/merge, all from our bash-completion package:
> > http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/bash-completion/current/SOURCES
> > 
> > Those patches add additional helper functions:
> > bash-completion-20060301-kernel-completion.patch
> 
> Since the function completes kernel versions (and not locations, for
> example), the funnction could be renamed to _kernel_versions or similar,
> for clarity.
Or _available_kernels, for consistency with _available_interfaces ?

> > bash-completion-20090108-device_ids.patch
> 
> _usb_ids looks good.
> 
> _pci_ids doesn't work here. If I do the following change:
> "lspci -n | awk '{print $4}'" ->  "lspci -n | awk '{print $3}'"
> it works on my system.
> 
> Maybe lspci behaves differently on Gentoo and Mandriva? I have version
> 3.0.2 here.
You're right. I guess the command output changed since I originaly wrote
this.

> > This patch makes a better command completion, allowing to specify an
> > offset in caller function (see our strace completion for an usage
> > example):
> > bash-completion-20090108-better-command-completion.patch
> 
> I'm not sure I got this right. Bash-completion already completes on
> 'sudo command', does this extend this making possible to specify also
> 'sudo' options?
By itself, no. But if you write a dedicated sudo completion function, in
order to handle those options for instance, instead of calling 'command'
function to handle the wrapped command completion and let it figure
where it has to start parsing the command line, you give it some hints
(the offset) to make its task easier (and more robust, because it's a
bit difficult for a generic function to figure what are wrapping command
options and what are not).




More information about the Bash-completion-devel mailing list