feat: Added file information command line option and fullscreen view

This commit is contained in:
WerWolv
2025-08-24 21:21:34 +02:00
parent 0178ba014a
commit 66efcf91d3
13 changed files with 323 additions and 132 deletions

View File

@@ -29,6 +29,7 @@
#include <content/providers/file_provider.hpp>
#include <content/views/fullscreen/view_fullscreen_save_editor.hpp>
#include <content/views/fullscreen/view_fullscreen_file_info.hpp>
namespace hex::plugin::builtin {
using namespace hex::literals;
@@ -521,6 +522,21 @@ namespace hex::plugin::builtin {
}
}
void handleFileInfoCommand(const std::vector<std::string> &args) {
if (args.size() != 1) {
log::println("usage: imhex --file-info <file>");
std::exit(EXIT_FAILURE);
}
const auto path = std::fs::path(args[0]);
if (!wolv::io::fs::exists(path)) {
log::println("File '{}' does not exist!", args[0]);
std::exit(EXIT_FAILURE);
}
ContentRegistry::Views::setFullScreenView<ViewFullScreenFileInfo>(path);
}
void registerCommandForwarders() {
hex::subcommands::registerSubCommand("open", [](const std::vector<std::string> &args){