14 void setup(CLI::App& app, std::shared_ptr<CLI::Formatter> formatter)
override {
15 auto subcmd = app.add_subcommand(
17 "Download and install a platform SDK matching the current eve version "
18 "(e.g. `eve get android`)");
19 subcmd->allow_extras();
23 auto subcmd = app.get_subcommand(
"get");
24 if (subcmd->parsed()) {
27 if (res == 0) cout << rang::fg::green <<
"Get " <<
name << rang::fg::reset << endl;
39 const Platform
p = parsePlatform(
name);
40 if (
name.empty() ||
p == Platform::Unknown) {
41 cerr << rang::fg::red <<
"eve get: unknown SDK '" <<
name
42 <<
"' (supported: android)" << rang::fg::reset << endl;
45 if (
p != Platform::Android) {
46 cerr << rang::fg::red <<
"eve get: automatic SDK install is not implemented for '"
47 << platformName(
p) <<
"' yet (supported: android)" << rang::fg::reset << endl;
50 auto result = installAndroidSdk();
51 if (result.ok())
return 0;
52 cerr << rang::fg::red <<
"eve get: " << result.status().describe() << rang::fg::reset << endl;
命令行模块(eve.cmd):run / build / package / test / zip / dev-server 等子命令入口。
static std::string get_remaining(CLI::App *sub, std::string default_path=".")
子命令剩余位置参数。
int Get(std::string url)
获取第三方源码。
void setup(CLI::App &app, std::shared_ptr< CLI::Formatter > formatter) override
Registers options on the CLI11 sub-app.
int parse(CLI::App &app, Cmdline &cmd) override
Parses arguments and runs the command; returns the exit code.
One eve <subcommand> handler: CLI setup + argument parsing.