From dedf2caa2d69e323e05b7bc1a6a1198adbe40d0d Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Sat, 3 Dec 2022 14:09:34 +0100 Subject: Header files fix Rename argument --- xmake/plugins/format/main.lua | 8 ++++---- xmake/plugins/format/xmake.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index add8a7663..228e46517 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -72,7 +72,7 @@ function main() table.insert(argv, "-i") -- set file to format - if option.get("file") then + if option.get("files") then -- list of files/path to format local files = option.get("file"):split(" ") for _, f in ipairs(files) do @@ -86,11 +86,11 @@ function main() for targetname, target in pairs(project.targets()) do -- source files for _, source in ipairs(target:sourcefiles()) do - table.insert(argv, path.join(projectdir,source)) + table.insert(argv, path.join(projectdir, source)) end -- header files - for _, header in ipairs(target:sourcefiles()) do - table.insert(argv, path.join(projectdir,header)) + for _, header in ipairs(target:headerfiles()) do + table.insert(argv, path.join(projectdir, header)) end end end diff --git a/xmake/plugins/format/xmake.lua b/xmake/plugins/format/xmake.lua index 1958efb97..d3a00039f 100644 --- a/xmake/plugins/format/xmake.lua +++ b/xmake/plugins/format/xmake.lua @@ -28,7 +28,7 @@ task("format") {'s', "style", "kv", nil, "Set the path of .clang-format file, a coding style".. "(LLVM, Google, Chromium, Mozilla, WebKit) or key value string" }, {nil, "create", "k", nil, "Create a .clang-format file from a coding style" }, - {'f', "file", "v", "*.cpp *.h *.hpp", "Set file path or glob pattern (*.cpp)"} + {'f', "files", "v", nil, "Set file path or glob pattern"} } } -- cgit v1.3.1