2#include "common/config.h"
8#if defined(EVENGINE_IOS)
12using namespace std::filesystem;
18 void setup(CLI::App& app, std::shared_ptr<CLI::Formatter> formatter)
override {
19 auto create = app.add_subcommand(
"doc",
"Query the online documentation for a class/function");
20 create->allow_extras();
24 auto create = app.get_subcommand(
"create");
25 if (create->parsed()) {
40#define OPEN_WEB_PAGE_CMD "start "
41#elif defined(__APPLE__) && !defined(EVENGINE_IOS)
42#define OPEN_WEB_PAGE_CMD "open "
43#elif defined(__unix__) && !defined(EVENGINE_ANDROID)
44#define OPEN_WEB_PAGE_CMD "xdg-open "
47static inline int openWebPage(
string url) {
48#if defined(EVENGINE_IOS)
49 return eve::ios::openURL(url) ? 0 : -1;
50#elif defined(OPEN_WEB_PAGE_CMD)
51 string cmd = OPEN_WEB_PAGE_CMD + url;
52 return system(cmd.c_str());
64 string url =
"https://evengine.github.io/EVEngine/";
66 cout <<
"EVEngine docs for '" <<
name <<
"': " << url <<
"\n";
68 cout <<
"EVEngine docs: " << url <<
"\n";
69 return openWebPage(url);
命令行模块(eve.cmd):run / build / package / test / zip / dev-server 等子命令入口。
int Doc(std::string name)
显示模块/函数/类型的文档。
static std::string get_remaining(CLI::App *sub, std::string default_path=".")
子命令剩余位置参数。
int parse(CLI::App &app, Cmdline &cmd) override
Parses arguments and runs the command; returns the exit code.
void setup(CLI::App &app, std::shared_ptr< CLI::Formatter > formatter) override
Registers options on the CLI11 sub-app.
One eve <subcommand> handler: CLI setup + argument parsing.