summaryrefslogtreecommitdiff
path: root/xmake/plugins/format/xmake.lua
diff options
context:
space:
mode:
authorA2va <[email protected]>2024-02-09 14:01:44 +0100
committerA2va <[email protected]>2024-02-09 14:01:44 +0100
commitff532d9dc4114503447bb5b0e8e274877610be85 (patch)
tree2ad3a664f95acde77fd93c2d9c2e487b889b32f1 /xmake/plugins/format/xmake.lua
parentcde78b29f0f7e0f45d237bb19d99b764133e2bac (diff)
Support build arguments in the format plugin
Diffstat (limited to 'xmake/plugins/format/xmake.lua')
-rw-r--r--xmake/plugins/format/xmake.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/xmake/plugins/format/xmake.lua b/xmake/plugins/format/xmake.lua
index ed2bf3d65..7979bb211 100644
--- a/xmake/plugins/format/xmake.lua
+++ b/xmake/plugins/format/xmake.lua
@@ -28,10 +28,20 @@ task("format")
{'s', "style", "kv", nil, "Set the path of .clang-format file, a coding style",
values = {"LLVM", "Google", "Chromium", "Mozilla", "WebKit"}},
{nil, "create", "k", nil, "Create a .clang-format file from a coding style"},
- {'f', "files", "v", nil, "Set files path with pattern",
+ {'g', "group", "kv", nil, "Format all targets of the given group. It support path pattern matching.",
+ "e.g.",
+ " xmake format -g test",
+ " xmake format -g test_*",
+ " xmake format --group=benchmark/*"},
+ {'f', "files", "kv", nil, "Build the given source files.",
"e.g.",
- " - xmake format -f src/main.c",
- " - xmake format -f 'src/*.c" .. path.envsep() .. "src/**.cpp'"}
+ " - xmake format --files=src/main.c",
+ " - xmake format --files='src/*.c' [target]",
+ " - xmake format --files='src/**.c|excluded_file.c",
+ " - xmake format --files='src/main.c" .. path.envsep() .. "src/test.c'" },
+ {},
+ {nil, "target", "v", nil, "The target name. It will format all default targets if this parameter is not specified."
+ , values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end }
}
}