From 16eaeb0888fbcf269464d8d6670c965c64379074 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 13 Nov 2022 08:39:15 +0800 Subject: Update main.lua --- xmake/plugins/format/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 2a63a93a8..17ce73066 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -56,12 +56,12 @@ function main() -- create style file local argv = {} local projectdir = project.directory() - if option.get("create-style") then - table.insert(argv, "--style=" .. option.get("create-style")) + if option.get("create") then + table.insert(argv, "--style=" .. (option.get("style") or "Google")) table.insert(argv, "--dump-config") os.execv(clang_format.program, argv, {stdout = path.join(projectdir, ".clang-format"), curdir = projectdir}) return - end + end -- set style file if option.get("style") then @@ -70,7 +70,7 @@ function main() -- inplace flag table.insert(argv, "-i") - + -- set file to format if option.get("file") then table.insert(argv, option.get("file")) -- cgit v1.3.1