New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell completion doesn't work on scripts with a dot in name #2166
Comments
Completion in general will not work with filenames ( While I'd discorage anyone from making an entry point script with a dot in the name ( The solution might be to normalize dots the same way we normalize dashes, by replacing them with underscores. |
I'll be working on this |
Hey @ziima, This PR #2275 should fix the issue you raised. It is important you setup an entry point in your from setuptools import setup
setup(
name='issue2166', # Your package name
version='0.1.0',
py_modules=['example'], # your example.py module
entry_points={
'console_scripts': [
'example.hello = example:main',
],
},
) See click's documentation on setup tools |
@OdinTech3 Nice, I looking forward for the change. I have the |
There shouldn't be anything different between dev and prod regarding entry points. |
I found out, that a shell completion doesn't work on scripts with a dot in their name, mainly the scripts themselves (without an entry point linked) or entry points with a dot in their name (less common). The main problem is that the dot is copied into the name of the completion variable.
MWE:
Let's have a script
/tmp/example.py
Completion on this script doesn't do anything using any of reasonable variable names:
I found out, click requires the variable
_EXAMPLE.PY_COMPLETE
to be set, which is not possible (at least) in bash.It would help if the dot was replaced by an underscore, the same way a dash is handled.
Environment:
The text was updated successfully, but these errors were encountered: