[Bash-completion-devel] [PATCH/RFC] ri: Rename ri_get_methods helper to add leading underscore

Igor Murzov intergalactic.anonymous at gmail.com
Wed Apr 18 13:46:22 UTC 2012


On Tue, 17 Apr 2012 13:52:02 -0500
Jonathan Nieder <jrnieder at gmail.com> wrote:

> Completions generally name the identifiers they export with a leading
> '_' to avoid clashing with user functions.  The only exception is this
> helper function in the "ri" completion script; fix it.
> 
> Reported-by: Felipe Contreras <felipe.contreras at gmail.com>
> ---
> Thanks for keeping the bash completion script collection well
> maintained.  Here's a small patch to address a nitpick.  What do you
> think?
> 
> Thanks,
> Jonathan
> 
>  completions/ri |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/completions/ri b/completions/ri
> index 43f6408a..62a9b709 100644
> --- a/completions/ri
> +++ b/completions/ri
> @@ -1,7 +1,7 @@
>  # ri completion for Ruby documentation                     -*- shell-script -*-
>  # by Ian Macdonald <ian at caliban.org>
>  
> -ri_get_methods()
> +_ri_get_methods()
>  {
>      local regex
>  
> @@ -56,7 +56,7 @@ _ri()
>          method=${cur#*$separator}
>          classes=( $class )
>          prefix="-P $class$separator"
> -        ri_get_methods
> +        _ri_get_methods
>          return 0
>      fi
>  
> @@ -82,7 +82,7 @@ _ri()
>  
>      # we're completing on methods
>      method=$cur
> -    ri_get_methods
> +    _ri_get_methods
>  } &&
>  complete -F _ri ri
>  
> -- 

Applied. Thanks. Fixed in commit: http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commit;h=8b3f19a82e60c725f8588a91b1679dde4b1b1967


-- Igor



More information about the Bash-completion-devel mailing list