Add hex.header configuration variable

This commit is contained in:
pancake 2017-03-24 02:57:10 +01:00
parent 1a5ffd5221
commit 51fcb5e2d2
2 changed files with 5 additions and 1 deletions

View File

@ -2049,6 +2049,7 @@ R_API int r_core_config_init(RCore *core) {
SETCB("fs.view", "normal", &cb_fsview, "Set visibility options for filesystems");
/* hexdump */
SETPREF("hex.header", "true", "Show header in hexdumps");
SETCB("hex.pairs", "true", &cb_hexpairs, "Show bytes paired in 'px' hexdump");
SETCB("hex.compact", "false", &cb_hexcompact, "Show smallest 16 byte col hexdump (60 columns)");
SETI("hex.flagsz", 0, "If non zero, overrides the flag size in pxa");

View File

@ -4085,10 +4085,13 @@ static int cmd_print(void *data, const char *input) {
{
int show_offset = r_config_get_i (core->config, "asm.offset");
if (show_offset) {
core->print->flags |= R_PRINT_FLAGS_HEADER;
core->print->flags |= R_PRINT_FLAGS_OFFSET;
} else {
core->print->flags &= ~R_PRINT_FLAGS_OFFSET;
}
if (r_config_get_i (core->config, "hex.header")) {
core->print->flags |= R_PRINT_FLAGS_HEADER;
} else {
core->print->flags &= ~R_PRINT_FLAGS_HEADER;
}
/* Don't show comments in default case */