mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-06 18:13:46 +00:00
Add -e cmd.exit to run commands before leaving ##shell
This commit is contained in:
parent
e295df766a
commit
a0f69577f5
@ -4021,6 +4021,7 @@ R_API int r_core_config_init(RCore *core) {
|
||||
SETPREF ("cmd.usr2", "", "run when SIGUSR2 signal is received");
|
||||
#endif
|
||||
SETPREF ("cmd.open", "", "run when file is opened");
|
||||
SETPREF ("cmd.exit", "", "run command before leaving the shell (atexit)");
|
||||
SETPREF ("cmd.load", "", "run when binary is loaded");
|
||||
SETPREF ("cmd.bbgraph", "", "show the output of this command in the graph basic blocks");
|
||||
RConfigNode *cmdpdc = NODECB ("cmd.pdc", "", &cb_cmdpdc);
|
||||
|
@ -1883,6 +1883,10 @@ R_API int r_main_radare2(int argc, const char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
const char *cmd_exit = r_config_get (r->config, "cmd.exit");
|
||||
if (R_STR_ISNOTEMPTY (cmd_exit)) {
|
||||
r_core_cmd0 (r, cmd_exit);
|
||||
}
|
||||
const char *prj = r_config_get (r->config, "prj.name");
|
||||
if (R_STR_ISNOTEMPTY (prj)) {
|
||||
if (r_core_project_is_dirty (r) && !r_config_get_b (r->config, "prj.alwaysprompt")) {
|
||||
|
Loading…
Reference in New Issue
Block a user