summaryrefslogtreecommitdiff
path: root/Editor/main.cpp
blob: 1e9f5a8d41621e3b9b2ab252dcade7a5bbb78ae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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();
}