From f71f4eef3ff5d13b56a48dee05a0185125626ebd Mon Sep 17 00:00:00 2001 From: Opportunity Date: Sun, 19 Jan 2020 13:05:27 +0800 Subject: add links --- xmake/core/base/cli.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xmake/core/base/cli.lua') diff --git a/xmake/core/base/cli.lua b/xmake/core/base/cli.lua index 9f5fd4344..effa1a0f2 100644 --- a/xmake/core/base/cli.lua +++ b/xmake/core/base/cli.lua @@ -18,8 +18,6 @@ -- @file cli.lua -- --- @see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html - -- define module local cli = cli or {} local segment = cli._segment or {} @@ -62,10 +60,14 @@ function cli._make_option(key, value, short, argv, argi) return cli._make_segment("option", short and ("-" .. key .. " " .. value) or ("--" .. key .. "=" .. value), argv, argi, { key = key, value = value, short = short or false }) end -function cli.parse(args, ...) - return cli.parsev(os.argv(args), ...) +-- parse a argv string, command & sub-command should be omitted before calling this function +-- @see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html +function cli.parse(args, flags) + return cli.parsev(os.argv(args), flags) end +-- parse a argv array, command & sub-command should be omitted before calling this function +-- @see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html function cli.parsev(argv, flags) local parsed = {} -- cgit v1.3.1