From 397c1fd739bb63eec505ff71188226a3f2b2fc9c Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Thu, 18 Jul 2019 16:16:58 -0400 Subject: [PATCH] Zsh completions: complete multiple option arguments --- src/argparse.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/argparse.lua b/src/argparse.lua index d7c069d..e78b6fb 100644 --- a/src/argparse.lua +++ b/src/argparse.lua @@ -1308,9 +1308,12 @@ function Parser:_zsh_arguments(buf, cmd_name, indent) if option._description then table.insert(line, "[" .. get_short_description(option) .. "]") end + if option._maxargs == math.huge then + table.insert(line, ":*") + end if option._choices then table.insert(line, ": :(" .. table.concat(option._choices, " ") .. ")") - elseif option._minargs > 0 then + elseif option._maxargs > 0 then table.insert(line, ": :_files") end table.insert(line, '"')