Skip to content

Commit e782a2f

Browse files
authored
Merge pull request #7608 from xmake-io/format
format menus
2 parents 9b8df1e + 6aeb1e3 commit e782a2f

23 files changed

Lines changed: 743 additions & 900 deletions

File tree

xmake/actions/build/xmake.lua

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,37 @@ task("build")
2222
set_category("main")
2323
on_run("main")
2424
set_menu {
25-
usage = "xmake [task] [options] [targets]"
26-
, description = "Build targets if no given tasks."
27-
, shortname = 'b'
28-
, options =
29-
{
30-
{nil, "version", "k", nil , "Print the version number and exit." }
31-
, {'b', "build", "k", nil , "Build target. This is default building mode and optional." }
32-
, {'r', "rebuild", "k", nil , "Rebuild the target." }
33-
, {'a', "all", "k", nil , "Build all targets." }
34-
, {nil, "shallow", "k", nil , "Only re-build the given targets without dependencies." }
35-
, {'g', "group", "kv", nil , "Build all targets of the given group. It support path pattern matching.",
36-
"e.g.",
37-
" xmake -g test",
38-
" xmake -g test_*",
39-
" xmake --group=benchmark/*" }
40-
, {nil, "dry-run", "k", nil , "Dry run to build target." }
41-
42-
, {}
43-
, {'j', "jobs", "kv", tostring(os.default_njob()),
44-
"Set the number of parallel compilation jobs." }
45-
, {nil, "linkjobs", "kv", nil, "Set the number of parallel link jobs." }
46-
, {'w', "warning", "k", false , "Enable the warnings output. (deprecated)" }
47-
, {nil, "linkonly", "k", false , "Only link targets if object files have been compiled." }
48-
, {nil, "files", "kv", nil , "Build the given source files.",
49-
"e.g. ",
50-
" - xmake --files=src/main.c",
51-
" - xmake --files='src/*.c' [target]",
52-
" - xmake --files='src/**.c|excluded_file.c'",
53-
" - xmake --files='src/main.c" .. path.envsep() .. "src/test.c'" }
54-
55-
, {}
56-
, {nil, "targets", "vs", nil , "The target names. It will build all default targets if this parameter is not specified.",
57-
"e.g.",
58-
" xmake build target1 target2 ..."
59-
, values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end }
60-
}
61-
}
62-
63-
64-
25+
usage = "xmake [task] [options] [targets]",
26+
description = "Build targets if no given tasks.",
27+
shortname = 'b',
28+
options = {
29+
{nil, "version", "k", nil, "Print the version number and exit."},
30+
{'b', "build", "k", nil, "Build target. This is default building mode and optional."},
31+
{'r', "rebuild", "k", nil, "Rebuild the target."},
32+
{'a', "all", "k", nil, "Build all targets."},
33+
{nil, "shallow", "k", nil, "Only re-build the given targets without dependencies."},
34+
{'g', "group", "kv", nil, "Build all targets of the given group. It supports path pattern matching.",
35+
"e.g.",
36+
" xmake -g test",
37+
" xmake -g test_*",
38+
" xmake --group=benchmark/*"},
39+
{nil, "dry-run", "k", nil, "Dry run to build target."},
40+
{},
41+
{'j', "jobs", "kv", tostring(os.default_njob()),
42+
"Set the number of parallel compilation jobs."},
43+
{nil, "linkjobs", "kv", nil, "Set the number of parallel link jobs."},
44+
{'w', "warning", "k", false, "Enable the warnings output. (deprecated)"},
45+
{nil, "linkonly", "k", false, "Only link targets if object files have been compiled."},
46+
{nil, "files", "kv", nil, "Build the given source files.",
47+
"e.g. ",
48+
" - xmake --files=src/main.c",
49+
" - xmake --files='src/*.c' [target]",
50+
" - xmake --files='src/**.c|excluded_file.c'",
51+
" - xmake --files='src/main.c" .. path.envsep() .. "src/test.c'"},
52+
{},
53+
{nil, "targets", "vs", nil, "The target names. It will build all default targets if this parameter is not specified.",
54+
"e.g.",
55+
" xmake build target1 target2 ...",
56+
values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end},
57+
}
58+
}

xmake/actions/clean/xmake.lua

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,21 @@
2121
task("clean")
2222
set_category("action")
2323
on_run("main")
24-
2524
set_menu {
26-
usage = "xmake clean|c [options] [targets]"
27-
, description = "Remove all binary and temporary files."
28-
, shortname = 'c'
29-
30-
, options =
31-
{
32-
{'a', "all", "k", nil , "Clean all auto-generated files by xmake." }
33-
, {'g', "group", "kv", nil , "Clean all targets of the given group. It support path pattern matching.",
34-
"e.g.",
35-
" xmake clean -g test",
36-
" xmake clean -g test_*",
37-
" xmake clean --group=benchmark/*" }
38-
39-
, {}
40-
, {nil, "targets", "vs", nil , "The target names. It will clean all default targets if this parameter is not specified.",
41-
"e.g.",
42-
" xmake clean target1 target2 ..."
43-
, values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end }
44-
}
45-
}
46-
47-
48-
25+
usage = "xmake clean|c [options] [targets]",
26+
description = "Remove all binary and temporary files.",
27+
shortname = 'c',
28+
options = {
29+
{'a', "all", "k", nil, "Clean all auto-generated files by xmake."},
30+
{'g', "group", "kv", nil, "Clean all targets of the given group. It supports path pattern matching.",
31+
"e.g.",
32+
" xmake clean -g test",
33+
" xmake clean -g test_*",
34+
" xmake clean --group=benchmark/*"},
35+
{},
36+
{nil, "targets", "vs", nil, "The target names. It will clean all default targets if this parameter is not specified.",
37+
"e.g.",
38+
" xmake clean target1 target2 ...",
39+
values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end},
40+
}
41+
}

0 commit comments

Comments
 (0)