chat: new applet by dronnikov AT gmail.com. With all options on:

function                                             old     new   delta
chat_main                                              -    1230   +1230
unescape                                               -     135    +135
packed_usage                                       23802   23922    +120
signal_handler                                       123     131      +8
input_backward                                       123     128      +5
applet_names                                        1775    1780      +5
applet_main                                         1076    1080      +4
applet_nameofs                                       538     540      +2
exitcode                                               -       1      +1
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 6/0 up/down: 1510/0)           Total: 1510 bytes
This commit is contained in:
Denis Vlasenko 2008-02-18 23:24:46 +00:00
parent 6f04391cec
commit 5233cd3800
4 changed files with 71 additions and 0 deletions

View File

@ -93,6 +93,7 @@ USE_BZIP2(APPLET(bzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_CAT(APPLET_NOFORK(cat, cat, _BB_DIR_BIN, _BB_SUID_NEVER, cat)) USE_CAT(APPLET_NOFORK(cat, cat, _BB_DIR_BIN, _BB_SUID_NEVER, cat))
USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_CHAT(APPLET(chat, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp))

View File

@ -204,6 +204,15 @@ USE_FEATURE_BRCTL_FANCY("\n" \
" -e End each line with $\n" \ " -e End each line with $\n" \
" -t Show tabs as ^I\n" \ " -t Show tabs as ^I\n" \
" -v Don't use ^x or M-x escapes" " -v Don't use ^x or M-x escapes"
#define chat_trivial_usage \
"EXPECT [SEND [EXPECT [SEND...]]]"
#define chat_full_usage \
"Useful for interacting with a modem connected to stdin/stdout.\n" \
"A script consists of one or more \"expect-send\" pairs of strings,\n" \
"each pair is a pair of arguments. Example:\n" \
"chat '' ATZ OK ATD123456 CONNECT '' ogin: pppuser word: ppppass '~'" \
#define chattr_trivial_usage \ #define chattr_trivial_usage \
"[-R] [-+=AacDdijsStTu] [-v version] files..." "[-R] [-+=AacDdijsStTu] [-v version] files..."
#define chattr_full_usage \ #define chattr_full_usage \

View File

@ -19,6 +19,66 @@ config BBCONFIG
The bbconfig applet will print the config file with which The bbconfig applet will print the config file with which
busybox was built. busybox was built.
config CHAT
bool "chat"
default n
help
Simple chat utility.
config FEATURE_CHAT_NOFAIL
bool "Enable NOFAIL expect strings"
default y
help
When enabled expect strings which are started with a dash trigger
no-fail mode. That is when expectation is not met within timeout
the script is not terminated but sends next SEND string and waits
for next EXPECT string. This allows to compose far more flexible
scripts.
config FEATURE_CHAT_TTY_HIFI
bool "Force STDIN to be a TTY"
default n
help
Original chat always treats STDIN as a TTY device and sets for it
so-called raw mode. This option turns on such behaviour.
config FEATURE_CHAT_IMPLICIT_CR
bool "Enable implicit Carriage Return"
default y
help
When enabled make chat to terminate all SEND strings with a "\r"
unless "\c" is met anywhere in the string.
config FEATURE_CHAT_SWALLOW_OPTS
bool "Swallow options"
default n
help
Busybox chat require no options. To make it not fail when used
in place of original chat (which has a bunch of options) turn
this on.
config FEATURE_CHAT_SEND_ESCAPES
bool "Support weird SEND escapes"
default n
help
Original chat uses some escape sequences in SEND arguments which
are not sent to device but rather performs special actions.
E.g. "\K" means to send a break sequence to device.
"\d" delays execution for a second, "\p" -- for a 1/100 of second.
Before turning this option on think twice: do you really need them?
config FEATURE_CHAT_VAR_ABORT_LEN
bool "Support variable-length ABORT conditions"
default n
help
Original chat uses fixed 50-bytes length ABORT conditions. Say N here.
config FEATURE_CHAT_CLR_ABORT
bool "Support revoking of ABORT conditions"
default n
help
Support CLR_ABORT directive.
config CHRT config CHRT
bool "chrt" bool "chrt"
default n default n

View File

@ -7,6 +7,7 @@
lib-y:= lib-y:=
lib-$(CONFIG_ADJTIMEX) += adjtimex.o lib-$(CONFIG_ADJTIMEX) += adjtimex.o
lib-$(CONFIG_BBCONFIG) += bbconfig.o lib-$(CONFIG_BBCONFIG) += bbconfig.o
lib-$(CONFIG_CHAT) += chat.o
lib-$(CONFIG_CHRT) += chrt.o lib-$(CONFIG_CHRT) += chrt.o
lib-$(CONFIG_CROND) += crond.o lib-$(CONFIG_CROND) += crond.o
lib-$(CONFIG_CRONTAB) += crontab.o lib-$(CONFIG_CRONTAB) += crontab.o