summaryrefslogtreecommitdiff
path: root/xmake/plugins/format/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-19 22:34:20 +0800
committerruki <[email protected]>2025-10-19 22:34:35 +0800
commit9fba3e92a48958cbba78bee3a6500455248800f6 (patch)
tree59736a98468a7a70ea0d917366a6102357e1663d /xmake/plugins/format/main.lua
parentb703ec328f42d6f5c4ed5e7185b35bc13730b7b0 (diff)
add action utils to get target and group
Diffstat (limited to 'xmake/plugins/format/main.lua')
-rw-r--r--xmake/plugins/format/main.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua
index efc825c2a..87744ad12 100644
--- a/xmake/plugins/format/main.lua
+++ b/xmake/plugins/format/main.lua
@@ -26,6 +26,7 @@ import("core.project.project")
import("lib.detect.find_tool")
import("private.action.require.impl.packagenv")
import("private.action.require.impl.install_packages")
+import("private.action.utils", {alias = "action_utils"})
-- match source files
function _match_sourcefiles(sourcefile, filepatterns)
@@ -173,14 +174,7 @@ function main()
table.insert(argv, "--verbose")
end
- local targetname
- local group_pattern = option.get("group")
- if group_pattern then
- group_pattern = "^" .. path.pattern(group_pattern) .. "$"
- else
- targetname = option.get("target")
- end
-
+ local targetname, group_pattern = action_utils.get_target_and_group()
local targets = _get_targets(targetname, group_pattern)
if option.get("files") then
local filepatterns = _get_file_patterns(option.get("files"))