1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-16 04:39:49 +00:00

fixed completion issues

This commit is contained in:
skywind3000
2018-11-26 00:01:23 +08:00
parent 9657251c4b
commit c81669e091

4
z.lua
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