Add autocompletion for wxf and wtf

This commit is contained in:
pancake 2016-10-27 17:11:24 +02:00
parent 961e9479dc
commit e8ddc68893
3 changed files with 9 additions and 6 deletions

View File

@ -49,7 +49,6 @@ R_API RList *r_core_list_themes(RCore *core) {
RList *files = NULL;
RListIter *iter;
const char *fn;
int ctr = 0;
char *home = r_str_home (".config/radare2/cons/");
RList *list = r_list_new ();

View File

@ -973,6 +973,9 @@ static int cmd_write(void *data, const char *input) {
}
} else if (*str == '?' || *str == '\0') {
eprintf ("Usage: wt[a] file [size] write 'size' bytes in current block to file\n");
eprintf (" wta [filename] - append to file\n");
eprintf (" wtf [filename] - write to file (see also wxf and wf?\n");
eprintf (" wt [filename] - alias for wtf\n");
free (ostr);
return 0;
} else {
@ -988,8 +991,8 @@ static int cmd_write(void *data, const char *input) {
} else if (*str=='a') { // "wta"
append = 1;
str++;
if (str[0]==' ') {
filename = str+1;
if (str[0] == ' ') {
filename = str + 1;
} else {
const char* prefix = r_config_get (core->config, "cfg.prefixdump");
snprintf (_fn, sizeof (_fn), "%s.0x%08"PFMT64x, prefix, core->offset);

View File

@ -548,7 +548,7 @@ static const char *radare_argv[] = {
"q", "q!",
"f", "fl", "fr", "f-", "f*", "fs", "fS", "fr", "fo", "f?",
"m", "m*", "ml", "m-", "my", "mg", "md", "mp", "m?",
"o", "o+", "oc", "on", "op", "o-", "x", "wf", "wF", "wt", "wp",
"o", "o+", "oc", "on", "op", "o-", "x", "wf", "wF", "wta", "wtf", "wp",
"t", "to ", "t-", "tf", "td", "td-", "tb", "te", "tl", "tk", "ts",
"(", "(*", "(-", "()", ".", ".!", ".(", "./",
"r", "r+", "r-",
@ -671,7 +671,6 @@ static int autocomplete(RLine *line) {
line->completion.argv = tmp_argv;
} else if ((!strncmp (line->buffer.data, "eco ", 4))) {
int i = 0;
int chr = 4;
int len = strlen (line->buffer.data + 4);
char *theme;
RList *themes = r_core_list_themes (core);
@ -719,7 +718,9 @@ static int autocomplete(RLine *line) {
!strncmp (line->buffer.data, "wF ", 3) ||
!strncmp (line->buffer.data, "cat ", 4) ||
!strncmp (line->buffer.data, "less ", 5) ||
!strncmp (line->buffer.data, "wt ", 3) ||
!strncmp (line->buffer.data, "wta ", 4) ||
!strncmp (line->buffer.data, "wtf ", 4) ||
!strncmp (line->buffer.data, "wxf ", 4) ||
!strncmp (line->buffer.data, "wp ", 3) ||
!strncmp (line->buffer.data, "Sd ", 3) ||
!strncmp (line->buffer.data, "Sl ", 3) ||