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 | |
| 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')
| -rw-r--r-- | shell/ash.c | 15 | ||||
| -rw-r--r-- | shell/hush.c | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index edcb7c028..6af14f551 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -9033,6 +9033,9 @@ static int getoptscmd(int, char **) FAST_FUNC; | |||
| 9033 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET | 9033 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET |
| 9034 | static int helpcmd(int, char **) FAST_FUNC; | 9034 | static int helpcmd(int, char **) FAST_FUNC; |
| 9035 | #endif | 9035 | #endif |
| 9036 | #if MAX_HISTORY | ||
| 9037 | static int historycmd(int, char **) FAST_FUNC; | ||
| 9038 | #endif | ||
| 9036 | #if ENABLE_SH_MATH_SUPPORT | 9039 | #if ENABLE_SH_MATH_SUPPORT |
| 9037 | static int letcmd(int, char **) FAST_FUNC; | 9040 | static int letcmd(int, char **) FAST_FUNC; |
| 9038 | #endif | 9041 | #endif |
| @@ -9106,6 +9109,9 @@ static const struct builtincmd builtintab[] = { | |||
| 9106 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET | 9109 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET |
| 9107 | { BUILTIN_NOSPEC "help" , helpcmd }, | 9110 | { BUILTIN_NOSPEC "help" , helpcmd }, |
| 9108 | #endif | 9111 | #endif |
| 9112 | #if MAX_HISTORY | ||
| 9113 | { BUILTIN_NOSPEC "history" , historycmd }, | ||
| 9114 | #endif | ||
| 9109 | #if JOBS | 9115 | #if JOBS |
| 9110 | { BUILTIN_REGULAR "jobs" , jobscmd }, | 9116 | { BUILTIN_REGULAR "jobs" , jobscmd }, |
| 9111 | { BUILTIN_REGULAR "kill" , killcmd }, | 9117 | { BUILTIN_REGULAR "kill" , killcmd }, |
| @@ -12621,6 +12627,15 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 12621 | } | 12627 | } |
| 12622 | #endif /* FEATURE_SH_EXTRA_QUIET */ | 12628 | #endif /* FEATURE_SH_EXTRA_QUIET */ |
| 12623 | 12629 | ||
| 12630 | #if MAX_HISTORY | ||
| 12631 | static int FAST_FUNC | ||
| 12632 | historycmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | ||
| 12633 | { | ||
| 12634 | show_history(line_input_state); | ||
| 12635 | return EXIT_SUCCESS; | ||
| 12636 | } | ||
| 12637 | #endif | ||
| 12638 | |||
| 12624 | /* | 12639 | /* |
| 12625 | * The export and readonly commands. | 12640 | * The export and readonly commands. |
| 12626 | */ | 12641 | */ |
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 | { |
