mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 08:20:02 -05:00
feat: Added file information command line option and fullscreen view
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user