sys: Allow multiple files to be opened through the command line

This commit is contained in:
WerWolv 2022-09-15 09:48:02 +02:00
parent 120e2bc300
commit 5462575f5c
1 changed files with 3 additions and 5 deletions

View File

@ -52,11 +52,9 @@ int main(int argc, char **argv, char **envp) {
if (argc == 1)
; // No arguments provided
else if (argc == 2)
EventManager::post<RequestOpenFile>(argv[1]);
else {
hex::log::fatal("Usage: {} [<file_name>]", argv[0]);
return EXIT_FAILURE;
else if (argc >= 2) {
for (auto i = 1; i < argc; i++)
EventManager::post<RequestOpenFile>(argv[i]);
}
window.loop();