Add new 'rh' command to show the filesize in human format

This commit is contained in:
pancake 2017-10-16 12:07:12 +02:00
parent 94271f186c
commit e97d7bd90a

View File

@ -204,6 +204,7 @@ static const char *help_msg_r[] = {
"r-", "num", "remove num bytes, move following data down",
"r+", "num", "insert num bytes, move following data up",
"rm" ," [file]", "remove file",
"rh" ,"", "show size in human format",
"r2" ," [file]", "launch r2",
NULL
};
@ -1053,6 +1054,15 @@ static int cmd_resize(void *data, const char *input) {
}
}
return true;
case 'h':
if (core->file) {
if (oldsize != -1) {
char *s = r_num_units (NULL, oldsize);
r_cons_printf ("%s\n", s);
free (s);
}
}
return true;
case '+': // "r+"
case '-': // "r-"
delta = (st64)r_num_math (core->num, input);