[Python] How to add option name to the Version option in Click

Discussão em 'Python' iniciado por Stack, Junho 20, 2025.

  1. Stack

    Stack Membro Participativo

    How can I add '-V' as an extra keyword to the "Version" option? I did this with the "Help" option but I couldn't with the "Version".

    I have this code:

    CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) # Help Parameter Customized
    @with_plugins(iter_entry_points('click_command_tree'))
    @click.group(cls=HelpColorsGroup,help_headers_color='yellow',help_options_color='cyan', context_settings=CONTEXT_SETTINGS)
    @click.version_option('0.01',prog_name='Educational Project' )


    [​IMG]

    Continue reading...

Compartilhe esta Página