diff --git a/xmake/modules/cli/archive.lua b/xmake/modules/cli/archive.lua index 8c32b58fe5f..578e6df7617 100644 --- a/xmake/modules/cli/archive.lua +++ b/xmake/modules/cli/archive.lua @@ -26,6 +26,7 @@ import("utils.archive.archive") local options = { {nil, "compress", "kv", nil, "Set the compress algorithm.", values = {"fastest", "faster", "default", "better", "best"}}, {'r', "recurse", "k", nil, "Enable recursive pattern."}, + {'w', "workdir", "kv", nil, "Set the working directory."}, {nil, "excludes", "kv", nil, "Set the excludes patterns.", "e.g.", " - xmake l cli.archive --excludes=\"*/dir/*|dir/*\" -o archivefile inputfiles"}, @@ -44,6 +45,7 @@ function main(...) local opt = {} opt.recurse = args.recurse opt.compress = args.compress + opt.curdir = args.workdir if args.excludes then opt.excludes = args.excludes:split("|") end diff --git a/xmake/modules/cli/extract.lua b/xmake/modules/cli/extract.lua index 8028106f8b1..e21258bc032 100644 --- a/xmake/modules/cli/extract.lua +++ b/xmake/modules/cli/extract.lua @@ -24,6 +24,7 @@ import("utils.archive.extract") -- the options local options = { + {'w', "workdir", "kv", nil, "Set the working directory."}, {nil, "excludes", "kv", nil, "Set the excludes patterns.", "e.g.", " - xmake l cli.extract --excludes=\"*/dir/*|dir/*\" -o outputdir archivefile"}, @@ -41,6 +42,7 @@ function main(...) local opt = {} opt.recurse = args.recurse + opt.curdir = args.workdir if args.excludes then opt.excludes = args.excludes:split("|") end