2#include "common/config.h"
8#if defined(EVENGINE_IOS)
12using namespace std::filesystem;
20 void setup(CLI::App& app, std::shared_ptr<CLI::Formatter> formatter)
override {
21 auto doc = app.add_subcommand(
"doc",
"Query the online documentation for a class/function");
23 doc->add_flag(
"--no-open",
no_open,
24 "Print the documentation URL without opening a browser (headless/CI)");
28 auto doc = app.get_subcommand(
"doc");
44#define OPEN_WEB_PAGE_CMD "start "
45#elif defined(__APPLE__) && !defined(EVENGINE_IOS)
46#define OPEN_WEB_PAGE_CMD "open "
47#elif defined(__unix__) && !defined(EVENGINE_ANDROID)
48#define OPEN_WEB_PAGE_CMD "xdg-open "
51static inline int openWebPage(
string url) {
52#if defined(EVENGINE_IOS)
53 return eve::ios::openURL(url) ? 0 : -1;
54#elif defined(OPEN_WEB_PAGE_CMD)
55 string cmd = OPEN_WEB_PAGE_CMD + url;
56 return system(cmd.c_str());
67 string url =
"https://evengine.github.io/EVEngine/";
69 cout <<
"EVEngine docs for '" << symbol <<
"': " << url <<
"\n";
71 cout <<
"EVEngine docs: " << url <<
"\n";
73 return openWebPage(url);
命令行模块(eve.cmd):run / build / package / test / zip / dev-server 等子命令入口。
int Doc(std::string name, bool noOpen=false)
显示模块/函数/类型的文档。
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.