47 lines
1006 B
C++
47 lines
1006 B
C++
#include "storypresent.h"
|
|
#include "dag_layout.h"
|
|
#include "xast_parse.h"
|
|
#include "dag_present.h"
|
|
#include "view_present.h"
|
|
#include <argsparser.h>
|
|
#include <QDebug>
|
|
#include <QMessageBox>
|
|
#include <QTextEdit>
|
|
#include <QtWidgets/QApplication>
|
|
|
|
|
|
using namespace args_parse;
|
|
using namespace std;
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
QApplication a(argc, argv);
|
|
|
|
ArgsParser cmdrec;
|
|
auto help_mode = std::make_shared<MatchMode>(0x000au, u8"打印帮助文档");
|
|
cmdrec << help_mode;
|
|
(*help_mode) << std::make_shared<IndexParam>(u8"StoryPresent", u8"程序名") << make_shared<FloatOption>(u8"help", u8"打印帮助文档");
|
|
|
|
auto rst = cmdrec.parse(argc, argv);
|
|
QTextEdit msg;
|
|
msg.setReadOnly(true);
|
|
if (!rst) {
|
|
msg.setWindowTitle(u8"参数输入错误");
|
|
msg.setPlainText(cmdrec.helperDoc());
|
|
msg.show();
|
|
}
|
|
else {
|
|
switch (rst->modeCode()) {
|
|
case 0x000au:
|
|
msg.setWindowTitle(u8"帮助信息");
|
|
msg.setPlainText(cmdrec.helperDoc());
|
|
msg.show();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
return a.exec();
|
|
}
|