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

Re: [PATCH] Complete python module arguments



Ronan Pigott wrote:
> Python modules can behave like commands in their own right. This allows
> modules to define _python_module_* functions that are used to complete
> module arguments. Also gets the ball rolling by defining completions for
> venv, a commonly used python module.

This looks like a good idea to me.

Our usual convention on naming of completion functions tends to use a
hyphen before the name of subcommands so, e.g. _git-reset completes for
git reset while helper functions have names like _git_modified.
Submodules are more similar to subcommands so this would imply a naming
convention of, e.g. _python_module-venv

Or if the underscore / hyphen mix is too ugly, we could perhaps consider
something like _pymodule-venv or _python-venv.

On my system, python3 -m venv -h also lists --system-site-packages and
--prompt options. -h - --help is perhaps fairly ubiquitous and could
be completed even where a custom function is not found (in addition to
default file completion).

And I think _directories would be a suitable completion for 'virtual
environment'.

The convention for descriptions is not to capitalise the first word.

Can a python module name as passed to -m contain any problematic
characters such as / or any that might have a special meaning to python
. perhaps?

Thanks

Oliver




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