[Bash-completion-devel] notations which need to be documented
Ville Skyttä
ville.skytta at iki.fi
Sat Jun 18 11:54:54 UTC 2011
On 06/13/2011 03:50 PM, Raphaël wrote:
> * why define split in:
> local cur prev words cword split
> eg: "if we use the -s (or -n =) switch in init_completion ..."
This is already documented in the _init_completion doc block. By the
way, it's needed only with -s, not -n.
> * why:
> $split && return 0
> eg: "if split is true, the last argument as been splitted according
> ... so we return here because ..."
>
> * why:
> [[ $COMPREPLY == *= ]] && compopt -o nospace
> eg: "compopt nospace is ignored if COMPREPLY contains more than 1
> element. In such case, if this completion ends with '=' we don't want a
> space to be appended. It may be seen as:
> ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} matches '^.*=$'
> "
No objections to documenting these, but do you have suggestions where to
document them? I don't think they need to be documented in every
completion where they're used. Maybe styleguide.txt? Maybe submit a
patch? ;)
More information about the Bash-completion-devel
mailing list