Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Complete python module arguments



"Ronan Pigott" wrote:
> Python module names must be valid python identifiers [1][2] (they are assigned to
> that name when imported afterall), however the argument to -m may also be a
> submodule, so module.submodule is valid e.g. `python -m http.server` is such
> a submodule. I've just tried it and TIL "." is valid in a zsh function name, so
> maybe it's good as is? Or do you think it should be mangled somehow?

I think leaving the dot is fine. We've already got three completion
functions with a dot in their name. After venv, http.server is probably
the next most useful or at least those are that two that I know I've
used.

Is a pity that _python_modules doesn't handle the submodules. For this
particular use case, I also wonder whether it's possible to filter for
modules that can be run in this manner.

Oliver




Messages sorted by: Reverse Date, Date, Thread, Author