Skip to content

Commit

Permalink
Remove commands (#53)
Browse files Browse the repository at this point in the history
* Remove join command
* Remove head command
* Remove less and directly list `ls` command
* Remove T commands and log related functions
* Remove `u` commands and `Q` alias
* Remove : commands
* Remove ' command (alias for =!)
* Remove \ (alias for =!) command
* Ignore ERROR cmd status
  • Loading branch information
ret2libc committed Oct 28, 2020
1 parent da956fe commit 9586737
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 1,191 deletions.
38 changes: 0 additions & 38 deletions librz/cons/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,44 +686,6 @@ RZ_API bool rz_cons_yesno(int def, const char *fmt, ...) {
return false;
}

RZ_API char *rz_cons_password(const char *msg) {
int i = 0;
char buf[256] = {0};
printf ("\r%s", msg);
fflush (stdout);
rz_cons_set_raw (1);
#if __UNIX__
RzCons *a = rz_cons_singleton ();
a->term_raw.c_lflag &= ~(ECHO | ECHONL);
// // required to make therm/iterm show the key
// // cannot read when enabled in this way
// a->term_raw.c_lflag |= ICANON;
tcsetattr (0, TCSADRAIN, &a->term_raw);
rz_sys_signal (SIGTSTP, SIG_IGN);
#endif
while (i < sizeof (buf) - 1) {
int ch = rz_cons_readchar ();
if (ch == 127) { // backspace
if (i < 1) {
break;
}
i--;
continue;
}
if (ch == '\r' || ch == '\n') {
break;
}
buf[i++] = ch;
}
buf[i] = 0;
rz_cons_set_raw (0);
printf ("\n");
#if __UNIX__
rz_sys_signal (SIGTSTP, SIG_DFL);
#endif
return strdup (buf);
}

RZ_API char *rz_cons_input(const char *msg) {
char *oprompt = rz_line_get_prompt ();
if (!oprompt) {
Expand Down
6 changes: 3 additions & 3 deletions librz/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ RZ_DEPS+=rz_debug rz_hash rz_bin rz_lang rz_io rz_anal rz_parse rz_bp rz_egg
RZ_DEPS+=rz_reg rz_search rz_syscall rz_socket rz_magic rz_crypto

OBJS=core.o cmd.o cmd_helps.o cfile.o cconfig.o visual.o cio.o yank.o libs.o agraph.o
OBJS+=fortune.o hack.o vasm.o patch.o cbin.o corelog.o rtr.o cmd_api.o
OBJS+=fortune.o hack.o vasm.o patch.o cbin.o rtr.o cmd_api.o
OBJS+=carg.o canal.o project.o gdiff.o casm.o disasm.o cplugin.o
OBJS+=vmenus.o vmenus_graph.o vmenus_zigns.o zdiff.o citem.o
OBJS+=task.o panels.o pseudo.o vmarks.o anal_tp.o anal_objc.o blaze.o cundo.o
OBJS+=task.o panels.o pseudo.o vmarks.o anal_tp.o anal_objc.o blaze.o
OBJS+=cannotated_code.o serialize_core.o

CFLAGS+=-I../../shlr/heap/include
Expand Down Expand Up @@ -45,7 +45,7 @@ include $(LTOP)/rules.mk

cmd.o: cmd_hash.c cmd_debug.c cmd_zign.c cmd_project.c \
cmd_open.c cmd_meta.c cmd_macro.c cmd_magic.c cmd_eval.c \
cmd_seek.c cmd_print.c cmd_help.c cmd_anal.c cmd_search.c cmd_log.c \
cmd_seek.c cmd_print.c cmd_help.c cmd_anal.c cmd_search.c cmd_plugins.c \
cmd_cmp.c cmd_write.c cmd_egg.c cmd_info.c cmd_type.c cmd_flag.c \
cmd_search_rop.c

Expand Down
8 changes: 0 additions & 8 deletions librz/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,13 +1164,6 @@ static bool cb_timezone(void *user, void *data) {
return true;
}

static bool cb_cfgcorelog(void *user, void *data) {
RzCore *core = (RzCore *) user;
RzConfigNode *node = (RzConfigNode *) data;
core->cfglog = node->i_value;
return true;
}

static bool cb_cfgdebug(void *user, void *data) {
RzCore *core = (RzCore*) user;
RzConfigNode *node = (RzConfigNode*) data;
Expand Down Expand Up @@ -3228,7 +3221,6 @@ RZ_API int rz_core_config_init(RzCore *core) {
SETBPREF ("cfg.plugins", "true", "Load plugins at startup");
SETCB ("time.fmt", "%Y-%m-%d %H:%M:%S %z", &cb_cfgdatefmt, "Date format (%Y-%m-%d %H:%M:%S %z)");
SETICB ("time.zone", 0, &cb_timezone, "Time zone, in hours relative to GMT: +2, -1,..");
SETCB ("cfg.corelog", "false", &cb_cfgcorelog, "Log changes using the T api needed for realtime syncing");
SETBPREF ("cfg.newtab", "false", "Show descriptions in command completion");
SETCB ("cfg.debug", "false", &cb_cfgdebug, "Debugger mode");
p = rz_sys_getenv ("EDITOR");
Expand Down
Loading

0 comments on commit 9586737

Please sign in to comment.