Skip to content

Automatically write module footers for click autocompletion for specified binaries#4056

Open
Crivella wants to merge 6 commits intoeasybuilders:developfrom
Crivella:feature-click_autocomplete
Open

Automatically write module footers for click autocompletion for specified binaries#4056
Crivella wants to merge 6 commits intoeasybuilders:developfrom
Crivella:feature-click_autocomplete

Conversation

@Crivella
Copy link
Contributor

@Crivella Crivella commented Feb 2, 2026

Currently, writing the module footers to automatically enable/disable click autocompletion on module load/unload is fairly cumbersome and can add significant chunks of repeated code to many easyconfigs.
See for example:

This PR adds a new configuration click_autocomplete_bins option to PythonPackage, to allow passing a list of strings (click script/binaries names) to specify which scripts should have autocompletion enabled.

The module footer required for autocompletion will be added both in the case of isolated PythonPackages or when PythonPackage is used through PythonBundle

NOTE

I am not running BINARY_NAME --help as a sanity check automatically as, even if it is the default for click the normal name can be altered (see https://click.palletsprojects.com/en/stable/documentation/#help-parameter-customization)

The _UPPERCASECOMMAND_COMPLETE=bash_source COMMAND instead should always produce a _aitw_viscosity_completion function for the bash completion (since we manually unset this when unloading the module).
This will also catch eventual changes in the behavior of click in the future

@Crivella Crivella force-pushed the feature-click_autocomplete branch from bbd5fef to 57597bc Compare February 2, 2026 14:25
Co-authored-by: Loris Ercole <30901257+lorisercole@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants