diff options
author | Flemming Madsen | 2013-04-07 18:47:24 +0200 |
---|---|---|
committer | Denys Vlasenko | 2013-04-07 18:47:24 +0200 |
commit | d96ffda62e9f9c88a6e43dc1926c5b775a611166 (patch) | |
tree | f5c691e02aae158e04b797e267f3fa779d591728 /shell/ash.c | |
parent | 3beab83e4f7f4213c185737e95dc4895f0059dd6 (diff) | |
download | busybox-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/ash.c')
-rw-r--r-- | shell/ash.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index edcb7c0..6af14f5 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9033,6 +9033,9 @@ static int getoptscmd(int, char **) FAST_FUNC; #if !ENABLE_FEATURE_SH_EXTRA_QUIET static int helpcmd(int, char **) FAST_FUNC; #endif +#if MAX_HISTORY +static int historycmd(int, char **) FAST_FUNC; +#endif #if ENABLE_SH_MATH_SUPPORT static int letcmd(int, char **) FAST_FUNC; #endif @@ -9106,6 +9109,9 @@ static const struct builtincmd builtintab[] = { #if !ENABLE_FEATURE_SH_EXTRA_QUIET { BUILTIN_NOSPEC "help" , helpcmd }, #endif +#if MAX_HISTORY + { BUILTIN_NOSPEC "history" , historycmd }, +#endif #if JOBS { BUILTIN_REGULAR "jobs" , jobscmd }, { BUILTIN_REGULAR "kill" , killcmd }, @@ -12621,6 +12627,15 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) } #endif /* FEATURE_SH_EXTRA_QUIET */ +#if MAX_HISTORY +static int FAST_FUNC +historycmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) +{ + show_history(line_input_state); + return EXIT_SUCCESS; +} +#endif + /* * The export and readonly commands. */ |