diff options
| author | ruki <[email protected]> | 2015-04-30 15:16:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-04-30 15:16:35 +0800 |
| commit | b58ecc2194967e75375116db9ca782cdfe261022 (patch) | |
| tree | 87229347340351578fc44a8aeea69c3cb7812f28 /xmake/scripts/base/main.lua | |
| parent | 84999518105e894be127ceb3237a3d260f23cda9 (diff) | |
add option module
Diffstat (limited to 'xmake/scripts/base/main.lua')
| -rw-r--r-- | xmake/scripts/base/main.lua | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index a049bee11..2b029fc88 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -24,11 +24,33 @@ local main = {} -- load modules -local utils = require("base/utils") +local utils = require("base/utils") +local option = require("base/option") + +-- init the option menu +option._MENU = +{ + {'p', "project", "Change to the given prject directory before doing anything." } +, {'f', "file", "Read FILE as a xmake.lua file." } +, {'d', "debug", "Print lots of debugging information." } +, {'v', "version", "Print the version number and exit." } +, {'h', "help", "Print this help message and exit." } +} -- the main function function main.done() - utils.trace("hello world!") + + -- done option first + if not option.done(xmake._ARGV) then + + -- print the help option + option.help() + + -- failed + return -1 + end + + -- ok return 0 end |
