On Wed, Sep 16, 2009 at 05:39:25PM +0200, Michael Hanselmann wrote:
> 
> ---
>  autotools/build-bash-completion |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion
> index 7368dab..cb738cd 100755
> --- a/autotools/build-bash-completion
> +++ b/autotools/build-bash-completion
> @@ -584,6 +584,14 @@ def GetCommands(filename, module):
>      raise Exception("Script %s doesn't have 'commands' attribute" %
>                      filename)
>  
> +  # Add the implicit "--help" option
> +  help_option = cli.cli_option("-h", "--help", default=False,
> +                               action="store_true")
> +
> +  for (_, _, optdef, _, _) in commands.itervalues():
> +    if help_option not in optdef:
> +      optdef.append(help_option)
> +

LGTM, but I hope that --help (or any other option) doesn't show unless one
already typed a '-'...

iustin

Reply via email to