diff options
Diffstat (limited to 'xmake/scripts')
| -rw-r--r-- | xmake/scripts/_xmake_main.lua | 1 | ||||
| -rw-r--r-- | xmake/scripts/base/main.lua | 34 |
2 files changed, 25 insertions, 10 deletions
diff --git a/xmake/scripts/_xmake_main.lua b/xmake/scripts/_xmake_main.lua index c407b8fae..7a6e5d738 100644 --- a/xmake/scripts/_xmake_main.lua +++ b/xmake/scripts/_xmake_main.lua @@ -25,7 +25,6 @@ xmake = xmake or {} xmake._ARGV = _ARGV xmake._VERSION = "XMake v1.0.1" xmake._PROGRAM_DIR = _PROGRAM_DIR -xmake._PROJECT_DIR = _PROJECT_DIR xmake._SCRIPTS_DIR = _PROGRAM_DIR .. "/scripts/" xmake._OPTIONS = {} diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index e790dacda..56e259efd 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -242,12 +242,12 @@ local menu = , {} , {'f', "file", "kv", "xmake.lua", "Read a given xmake.lua file." } - , {nil, nil, "v", nil, "Change to the given project directory." + , {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" - , " 1. the last argument of the current command: ..." + , " 1. the given command argument" , " 2. the envirnoment variable: XMAKE_PROJECT_DIR" , " 3. the current directory" } - + , {} , {nil, "target", "v", nil, "Clean for the given target." , "Clean all targets if not exists." } @@ -279,9 +279,16 @@ function main.done_option() -- done help if options.help then + + -- print menu option.print_menu(options._ACTION) + + -- ok + return true + -- done version elseif options.version then + -- print title if option._MENU.title then print(option._MENU.title) @@ -291,13 +298,22 @@ function main.done_option() if option._MENU.copyright then print(option._MENU.copyright) end - -- done action - else - return main.done_action() + + -- ok + return true end - - -- ok - return true + + -- init the project directory + options.project = options.project or _PROJECT_DIR + options.project = path.getabsolute(options.project) + print(options.project) + + -- init the xmake.lua file path + options.file = options.file or "xmake.lua" + print(options.file) + + -- done action + return main.done_action() end -- the main function |
