1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

HexEditor: Add an option to load an annotations file on startup

This commit is contained in:
Sam Atkins 2024-01-30 12:53:36 +00:00 committed by Sam Atkins
parent 4cef57a021
commit d930ea1242
4 changed files with 29 additions and 2 deletions

View file

@ -27,8 +27,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto app = TRY(GUI::Application::create(arguments));
StringView filename;
StringView annotations_filename;
Core::ArgsParser args_parser;
args_parser.add_option(annotations_filename, "Annotations file to load", "annotations", 'a', "path");
args_parser.add_positional_argument(filename, "File to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments);
@ -69,5 +71,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
hex_editor_widget->open_file(response.value().filename(), response.value().release_stream());
}
if (!annotations_filename.is_empty())
hex_editor_widget->open_annotations_file(annotations_filename);
return app->exec();
}