From c8d424baeb7b93e2a1e900b271bcc09144fdce94 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 11 Dec 2025 23:01:24 +0800 Subject: improve binutils and add cli modules --- xmake/modules/utils/binary/bin2c.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'xmake/modules/utils/binary/bin2c.lua') diff --git a/xmake/modules/utils/binary/bin2c.lua b/xmake/modules/utils/binary/bin2c.lua index 34d9c4e02..7bbc797a4 100644 --- a/xmake/modules/utils/binary/bin2c.lua +++ b/xmake/modules/utils/binary/bin2c.lua @@ -20,16 +20,8 @@ -- imports import("core.base.bytes") -import("core.base.option") import("core.base.binutils") -local options = { - {'w', "linewidth", "kv", nil, "Set the line width"}, - {nil, "nozeroend", "k", false, "Disable to patch zero terminating character"}, - {'i', "binarypath", "kv", nil, "Set the binary file path."}, - {'o', "outputpath", "kv", nil, "Set the output file path."} -} - function _do_dump(binarydata, outputfile, opt) local i = 0 local n = 147 @@ -71,7 +63,7 @@ function _do_dump(binarydata, outputfile, opt) end end -function _do_bin2c(binarypath, outputpath, opt) +function main(binarypath, outputpath, opt) -- init source directory and options opt = opt or {} @@ -117,15 +109,3 @@ function _do_bin2c(binarypath, outputpath, opt) cprint("${bright}%s generated!", outputpath) end -function main(...) - - -- parse arguments - local argv = {...} - local opt = option.parse(argv, options, "Print c/c++ code files from the given binary file." - , "" - , "Usage: xmake l utils.binary.bin2c [options]") - - -- do bin2c - _do_bin2c(opt.binarypath, opt.outputpath, opt) -end - -- cgit v1.3.1