[Bash-completion-devel] completion for ipv6calc

Freddy Vulto fvulto at gmail.com
Fri Jan 15 08:31:25 UTC 2010


On 100114 20:56, Ville Skyttä wrote:
> On Sunday 10 January 2010, Freddy Vulto wrote:
> > On 100103 12:43, Guillaume Rousse wrote:
> > > Shouldn't we try to have variable and function names more consistent ?
> > > Aka rename _get_cword and _get_pword to _get_cur and _get_prev, or
> > > rename cur and prev to cword and pword ?
> > 
> > Maybe we can put this to the roadmap and join this with the effort of
> > centralizing the call to _get_cword alltogether once we do dynamic
> > completion?
> 
> If planning to rename something, please keep in mind the namespace prefix item 
> in the roadmap.

Maybe we'd also better merge _get_cword and _get_pword together to a new:

   _get_cwords_by_ref 'nonwordbreakchars' cur [prev [prevprev] ...]

with `prev', `prevprev', etc.  being optional arguments.

This circumvents doing the same cwords-parsing repeatedly when calling
both _get_cword and _get_pword.  This also fixes situations where
`nonwordbreakchars' passed to _get_cword and _get_pword aren't the same,
which they should be.  Plus it saves us a subshell call and we have
consistent naming.

Regards,

Freddy
http://fvue.nl



More information about the Bash-completion-devel mailing list