diff options
| author | Opportunity <[email protected]> | 2020-01-15 15:21:03 +0800 |
|---|---|---|
| committer | Opportunity <[email protected]> | 2020-01-15 15:21:03 +0800 |
| commit | 51a04e4cdf53c5e33913999c5d3c48ae6198307f (patch) | |
| tree | 077acada186d62b490ef7ec933993d400a7a04c5 | |
| parent | 546d83dd435780a6ea69a5b24a12c06b294dd2c0 (diff) | |
clean up
| -rw-r--r-- | xmake/core/main.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua index d54c56228..1078175d6 100644 --- a/xmake/core/main.lua +++ b/xmake/core/main.lua @@ -23,7 +23,6 @@ local main = main or {} -- load modules local os = require("base/os") -local cli = require("base/cli") local log = require("base/log") local path = require("base/path") local utils = require("base/utils") @@ -130,19 +129,18 @@ function main._basicparse() end -- parse options - local options, err = option.parse(xmake._COMMAND_ARGV, task.common_options(), { allow_unknown = true }) - if not options then - utils.error(err) - end - - return options.project, options.file + return option.parse(xmake._COMMAND_ARGV, task.common_options(), { allow_unknown = true }) end -- the init function for main function main._init() -- get project directory and project file from the argument option - local opt_projectdir, opt_projectfile = main._basicparse() + local options, err = main._basicparse() + if not options then + return false, err + end + local opt_projectdir, opt_projectfile = options.project, options.file -- init the project directory local projectdir = opt_projectdir or xmake._PROJECT_DIR |
