Add 'r2' command

This commit is contained in:
pancake 2015-10-30 01:45:49 +01:00
parent f88b35afba
commit 36558baf54
2 changed files with 6 additions and 0 deletions

View File

@ -733,6 +733,10 @@ static int cmd_resize(void *data, const char *input) {
oldsize = r_io_desc_size (core->io, core->file->desc);
else oldsize = 0;
switch (*input) {
case '2':
// TODO: use argv[0] instead of 'radare2'
r_sys_cmdf ("radare%s", input);
return true;
case 'm':
if (input[1]==' ')
r_file_rm (input+2);
@ -767,6 +771,7 @@ static int cmd_resize(void *data, const char *input) {
"r-", "num", "remove num bytes, move following data down",
"r+", "num", "insert num bytes, move following data up",
"rm" ," [file]", "remove file",
"r2" ," [file]", "launch r2",
NULL};
r_core_cmd_help (core, help_msg);
}

View File

@ -511,6 +511,7 @@ static int autocomplete(RLine *line) {
if ((!strncmp (line->buffer.data, "o ", 2)) ||
!strncmp (line->buffer.data, "o+ ", 3) ||
!strncmp (line->buffer.data, "oc ", 3) ||
!strncmp (line->buffer.data, "r2 ", 3) ||
!strncmp (line->buffer.data, "cd ", 3) ||
!strncmp (line->buffer.data, "on ", 3) ||
!strncmp (line->buffer.data, "op ", 3) ||