mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
feat: Added New File option to the GNOME launcher and a --new cli option
This commit is contained in:
@@ -12,6 +12,7 @@ namespace hex::plugin::builtin {
|
||||
void handleVerboseCommand(const std::vector<std::string> &args);
|
||||
|
||||
void handleOpenCommand(const std::vector<std::string> &args);
|
||||
void handleNewCommand(const std::vector<std::string> &args);
|
||||
|
||||
void handleCalcCommand(const std::vector<std::string> &args);
|
||||
void handleHashCommand(const std::vector<std::string> &args);
|
||||
|
||||
@@ -116,6 +116,10 @@ namespace hex::plugin::builtin {
|
||||
hex::subcommands::forwardSubCommand("open", fullPaths);
|
||||
}
|
||||
|
||||
void handleNewCommand(const std::vector<std::string> &) {
|
||||
hex::subcommands::forwardSubCommand("new", {});
|
||||
}
|
||||
|
||||
void handleCalcCommand(const std::vector<std::string> &args) {
|
||||
if (args.empty()) {
|
||||
hex::log::println("No expression provided!");
|
||||
@@ -386,6 +390,10 @@ namespace hex::plugin::builtin {
|
||||
RequestOpenFile::post(arg);
|
||||
}
|
||||
});
|
||||
|
||||
hex::subcommands::registerSubCommand("new", [](const std::vector<std::string> &){
|
||||
RequestOpenWindow::post("Create File");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,6 +66,7 @@ IMHEX_PLUGIN_SUBCOMMANDS() {
|
||||
{ "verbose", "v", "Enables verbose debug logging", hex::plugin::builtin::handleVerboseCommand },
|
||||
|
||||
{ "open", "o", "Open files passed as argument. [default]", hex::plugin::builtin::handleOpenCommand },
|
||||
{ "new", "n", "Create a new empty file", hex::plugin::builtin::handleNewCommand },
|
||||
|
||||
{ "calc", "", "Evaluate a mathematical expression", hex::plugin::builtin::handleCalcCommand },
|
||||
{ "hash", "", "Calculate the hash of a file", hex::plugin::builtin::handleHashCommand },
|
||||
|
||||
Reference in New Issue
Block a user