From f77e469ad60973f45e1ee178f1d66686d326a75a Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Thu, 27 Feb 2025 12:01:45 -0700 Subject: 53393: Complete python module arguments 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, http.server, and json.tool. --- Completion/Unix/Command/_python | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Completion/Unix/Command/_python') diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index 6e209a199..a5d46cfd6 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -56,6 +56,9 @@ case "$state" in if [[ -z "$opt_args[(I)-(c|m)]" ]]; then shift words (( CURRENT-- )) + elif [[ -n "$opt_args[(I)-m]" ]]; then + local ret + _call_function ret _python_module-$opt_args[-m] && return ret fi _normal && return ;; -- cgit v1.2.3