diff options
author | Flemming Madsen <busybox@themadsens.dk> | 2013-04-07 18:47:24 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-04-07 18:47:24 +0200 |
commit | d96ffda62e9f9c88a6e43dc1926c5b775a611166 (patch) | |
tree | f5c691e02aae158e04b797e267f3fa779d591728 /shell/hush.c | |
parent | 3beab83e4f7f4213c185737e95dc4895f0059dd6 (diff) | |
download | busybox-w32-d96ffda62e9f9c88a6e43dc1926c5b775a611166.tar.gz busybox-w32-d96ffda62e9f9c88a6e43dc1926c5b775a611166.tar.bz2 busybox-w32-d96ffda62e9f9c88a6e43dc1926c5b775a611166.zip |
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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index 1d421dc38..7cebe1784 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -850,6 +850,9 @@ static int builtin_jobs(char **argv) FAST_FUNC; | |||
850 | #if ENABLE_HUSH_HELP | 850 | #if ENABLE_HUSH_HELP |
851 | static int builtin_help(char **argv) FAST_FUNC; | 851 | static int builtin_help(char **argv) FAST_FUNC; |
852 | #endif | 852 | #endif |
853 | #if MAX_HISTORY | ||
854 | static int builtin_history(char **argv) FAST_FUNC; | ||
855 | #endif | ||
853 | #if ENABLE_HUSH_LOCAL | 856 | #if ENABLE_HUSH_LOCAL |
854 | static int builtin_local(char **argv) FAST_FUNC; | 857 | static int builtin_local(char **argv) FAST_FUNC; |
855 | #endif | 858 | #endif |
@@ -919,6 +922,9 @@ static const struct built_in_command bltins1[] = { | |||
919 | #if ENABLE_HUSH_HELP | 922 | #if ENABLE_HUSH_HELP |
920 | BLTIN("help" , builtin_help , NULL), | 923 | BLTIN("help" , builtin_help , NULL), |
921 | #endif | 924 | #endif |
925 | #if MAX_HISTORY | ||
926 | BLTIN("history" , builtin_history , "Show command history"), | ||
927 | #endif | ||
922 | #if ENABLE_HUSH_JOB | 928 | #if ENABLE_HUSH_JOB |
923 | BLTIN("jobs" , builtin_jobs , "List jobs"), | 929 | BLTIN("jobs" , builtin_jobs , "List jobs"), |
924 | #endif | 930 | #endif |
@@ -8627,6 +8633,14 @@ static int FAST_FUNC builtin_help(char **argv UNUSED_PARAM) | |||
8627 | } | 8633 | } |
8628 | #endif | 8634 | #endif |
8629 | 8635 | ||
8636 | #if MAX_HISTORY | ||
8637 | static int FAST_FUNC builtin_history(char **argv UNUSED_PARAM) | ||
8638 | { | ||
8639 | show_history(G.line_input_state); | ||
8640 | return EXIT_SUCCESS; | ||
8641 | } | ||
8642 | #endif | ||
8643 | |||
8630 | #if ENABLE_HUSH_JOB | 8644 | #if ENABLE_HUSH_JOB |
8631 | static int FAST_FUNC builtin_jobs(char **argv UNUSED_PARAM) | 8645 | static int FAST_FUNC builtin_jobs(char **argv UNUSED_PARAM) |
8632 | { | 8646 | { |