Engine 0.0.6
Game engine in lua
Loading...
Searching...
No Matches
main.lua
Go to the documentation of this file.
1local os = require('os')
2
3local zeebo_argparse = require('src/lib/cli/argparse')
4
5local commands_build = require('src/cli/commands/build')
6local commands_cli = require('src/cli/commands/cli')
7local commands_fs = require('src/cli/commands/fs')
8local commands_game = require('src/cli/commands/game')
9local commands_info = require('src/cli/commands/info')
10local commands_tools = require('src/cli/commands/tools')
11
14 .add_next_value('game', {require=true, alias='@examples/{{game}}/game.lua'})
15 .add_option_get('dist', {default='{game}'})
16 --
17 .add_subcommand('build', commands_build)
18 .add_next_value('game', {alias='@examples/{{game}}/game.lua'})
19 .add_option_get('dist', {default='./dist/'})
20 .add_option_get('core', {default='ginga'})
21 .add_option_get('screen', {default='1280x720'})
22 .add_option_has('bundler')
24 --
26 .add_next_value('game', {required=true, alias='@examples/{{game}}/game.lua'})
27 .add_option_get('core', {default='love'})
28 .add_option_get('screen', {default='1280x720'})
29 --
30 .add_subcommand('meta', commands_game)
31 .add_next_value('game', {required=true, alias='@examples/{{game}}/game.lua'})
32 .add_option_get('format', {default='{{title}} {{version}}', alias=commands_game.meta_alias})
33 --
34 .add_subcommand('bundler', commands_tools)
35 .add_next_value('file', {required=true})
36 .add_option_get('dist', {default='./dist/'})
37 --
38 .add_subcommand('compiler', commands_tools)
39 .add_next_value('file', {required=true})
40 .add_option_get('dist', {default='a.out'})
41 --
42 .add_subcommand('tool-love-zip', commands_tools)
43 .add_next_value('path', {required=true})
44 .add_option_get('dist', {required=true})
45 --
46 .add_subcommand('tool-love-exe', commands_tools)
47 .add_next_value('file', {required=true})
48 .add_option_get('dist', {required=true})
49 --
50 .add_subcommand('fs-replace', commands_fs)
51 .add_next_value('file', {required=true})
52 .add_next_value('dist', {required=true})
53 .add_option_get('format', {required=true})
54 .add_option_get('replace', {required=true})
55 --
56 .add_subcommand('fs-download', commands_fs)
57 .add_next_value('url', {required=true})
58 .add_next_value('dist', {required=true})
59 --
60 .add_subcommand('cli-build', commands_cli)
61 .add_option_get('dist', {default='./dist/'})
62 .add_subcommand('cli-test', commands_cli)
63 .add_option_has('coverage')
64 .add_subcommand('cli-dump', commands_cli)
65 --
66 .add_subcommand('version', commands_info)
67 .add_help_subcommand('help', commands_info)
68 .add_next_value('usage', {})
69 .add_error_cmd_usage('correct-usage', commands_info)
70 .add_error_cmd_not_found('not-found', commands_info)
71
72local ok, message = command.run()
73
74if message then
75 print(message)
76end
77
78if not ok and os and os.exit then
79 os.exit(1)
80end
81
82return commands_info.meta()
build
Definition build.lua:20
local function from(host_args)
local function add_subcommand(self, cmd_name, cmd_collection)
local function add_option_has(self, param)
local function require(std, game, application)
local function init(args)
local commands_cli
Definition main.lua:6
local commands_info
Definition main.lua:9
add_next_value('game', {require=true, alias=' @examples/{{game}}/game.lua'})
local commands_build
Definition main.lua:5
add_option_get('dist', {default='{game}'})
local commands_tools
Definition main.lua:10
local commands_fs
Definition main.lua:7
local os
Definition main.lua:1
local command
Definition main.lua:12
local ok
Definition main.lua:40
local zeebo_argparse
Definition main.lua:3
local commands_game
Definition main.lua:8
local message
Definition main.lua:40
local game
Definition main.lua:17