1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-15 01:02:21 +00:00
serenity/Editor/main.cpp
2018-12-04 00:27:16 +01:00

19 lines
434 B
C++

#include "Document.h"
#include "Editor.h"
#include <stdio.h>
int main(int c, char** v)
{
std::string file_to_open = "cuki.h";
if (c > 1) {
file_to_open = v[1];
}
auto document = Document::create_from_file(file_to_open);
if (!document) {
fprintf(stderr, "Failed to open file.\n");
return 1;
}
Editor editor;
editor.set_document(std::move(document));
return editor.exec();
}