-
-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Milestone
Description
When generating completions, we use the following logic to infer the command name:
cleo/cleo/commands/completions_command.py
Lines 133 to 137 in 06ba9ea
| # FIXME: when generating completions via `python -m script completions`, | |
| # we incorrectly infer `script_name` as `__main__.py` | |
| script_name = self._io.input.script_name or inspect.stack()[-1][1] | |
| script_path = posixpath.realpath(script_name) | |
| script_name = os.path.basename(script_path) |
As stated, this doesn't work when running the script as a module via python -m:
$ poetry completions zsh | head -1
#compdef poetry
$ python -m poetry completions zsh | head -1
#compdef __main__.pyWe should fix this
Note: I noticed this since Arch Linux has to work around it: https://github.com/archlinux/svntogit-community/blob/packages/python-poetry/trunk/poetry-completions-generator
Secrus
Metadata
Metadata
Assignees
Labels
No labels