summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorFlemming Madsen2013-04-07 18:47:24 +0200
committerDenys Vlasenko2013-04-07 18:47:24 +0200
commitd96ffda62e9f9c88a6e43dc1926c5b775a611166 (patch)
treef5c691e02aae158e04b797e267f3fa779d591728 /shell/hush.c
parent3beab83e4f7f4213c185737e95dc4895f0059dd6 (diff)
downloadbusybox-d96ffda62e9f9c88a6e43dc1926c5b775a611166.zip
busybox-d96ffda62e9f9c88a6e43dc1926c5b775a611166.tar.gz
ash,hush: history builtin
function old new delta show_history - 39 +39 builtin_history - 16 +16 historycmd - 13 +13 bltins1 312 324 +12 builtintab 336 344 +8 popstring 134 140 +6 hush_main 1048 1046 -2 ash_main 1398 1396 -2 size_from_HISTFILESIZE 44 40 -4 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 3/3 up/down: 94/-8) Total: 86 bytes Signed-off-by: Flemming Madsen <busybox@themadsens.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 1d421dc..7cebe17 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -850,6 +850,9 @@ static int builtin_jobs(char **argv) FAST_FUNC;
#if ENABLE_HUSH_HELP
static int builtin_help(char **argv) FAST_FUNC;
#endif
+#if MAX_HISTORY
+static int builtin_history(char **argv) FAST_FUNC;
+#endif
#if ENABLE_HUSH_LOCAL
static int builtin_local(char **argv) FAST_FUNC;
#endif
@@ -919,6 +922,9 @@ static const struct built_in_command bltins1[] = {
#if ENABLE_HUSH_HELP
BLTIN("help" , builtin_help , NULL),
#endif
+#if MAX_HISTORY
+ BLTIN("history" , builtin_history , "Show command history"),
+#endif
#if ENABLE_HUSH_JOB
BLTIN("jobs" , builtin_jobs , "List jobs"),
#endif
@@ -8627,6 +8633,14 @@ static int FAST_FUNC builtin_help(char **argv UNUSED_PARAM)
}
#endif
+#if MAX_HISTORY
+static int FAST_FUNC builtin_history(char **argv UNUSED_PARAM)
+{
+ show_history(G.line_input_state);
+ return EXIT_SUCCESS;
+}
+#endif
+
#if ENABLE_HUSH_JOB
static int FAST_FUNC builtin_jobs(char **argv UNUSED_PARAM)
{