summaryrefslogtreecommitdiff
path: root/xmake/plugins/format/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-06-18 22:54:54 +0800
committerruki <[email protected]>2026-06-18 22:54:54 +0800
commit849606b78fe250ed3315fb65a085ca6c860ddcaf (patch)
tree2b49c22a80d475f258a59b73fb3533f0f4f353d7 /xmake/plugins/format/xmake.lua
parent9b8df1e3c6bf7aa841c3c62f8f80d5016690367b (diff)
format menus
Diffstat (limited to 'xmake/plugins/format/xmake.lua')
-rw-r--r--xmake/plugins/format/xmake.lua63
1 files changed, 31 insertions, 32 deletions
diff --git a/xmake/plugins/format/xmake.lua b/xmake/plugins/format/xmake.lua
index 5de1b8120..4adb2b85a 100644
--- a/xmake/plugins/format/xmake.lua
+++ b/xmake/plugins/format/xmake.lua
@@ -22,35 +22,34 @@ task("format")
set_category("plugin")
on_run("main")
set_menu {
- usage = "xmake format [options] [arguments]",
- description = "Format the current project.",
- options = {
- {'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"},
- {'n', "dry-run", "k", nil, "Do not make any changes, just show the files that would be formatted."},
- {'e', "error", "k", nil, "If set, changes formatting warnings to errors."},
- {'j', "jobs", "kv", tostring(os.default_njob()),
- "Set the number of parallel format jobs."},
- {'a', "all", "k", nil, "Format all targets."},
- {'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 --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, "targets", "vs", nil, "The target names. It will format all default targets if this parameter is not specified.",
- "e.g.",
- " xmake format target1 target2 ..."
- , values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end }
- }
- }
-
-
-
+ usage = "xmake format [options] [arguments]",
+ description = "Format the current project.",
+ options = {
+ {'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"},
+ {'n', "dry-run", "k", nil, "Do not make any changes, just show the files that would be formatted."},
+ {'e', "error", "k", nil, "If set, changes formatting warnings to errors."},
+ {'j', "jobs", "kv", tostring(os.default_njob()),
+ "Set the number of parallel format jobs."},
+ {'a', "all", "k", nil, "Format all targets."},
+ {'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 --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, "targets", "vs", nil, "The target names. It will format all default targets if this parameter is not specified.",
+ "e.g.",
+ " xmake format target1 target2 ...",
+ values = function (complete, opt)
+ return import("private.utils.complete_helper.targets")(complete, opt)
+ end},
+ }
+ }