fixed completion issues

This commit is contained in:
skywind3000
2018-11-26 00:01:23 +08:00
parent 9657251c4b
commit c81669e091
+3 -1
View File
@@ -1061,7 +1061,9 @@ function main(argv)
local M = z_match(args and args or {}, Z_METHOD, Z_SUBDIR)
z_print(M)
elseif options['--complete'] then
local M = z_match(args and args or {}, Z_METHOD, Z_SUBDIR)
local line = args[1] and args[1] or ''
local head = line:sub(Z_CMD:len()+1):gsub('^%s+', '')
local M = z_match({head}, Z_METHOD, Z_SUBDIR)
for _, item in pairs(M) do
print(item.name)
end