summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-18 23:24:46 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-18 23:24:46 +0000
commit5233cd38003724fad3b4355174d367337f5a3d49 (patch)
treed1f2e4ea4d414702d18d7cfc7f44cef01be585d5
parent6f04391cecd8579f4bf5007b456e9ee79d718cff (diff)
downloadbusybox-w32-5233cd38003724fad3b4355174d367337f5a3d49.tar.gz
busybox-w32-5233cd38003724fad3b4355174d367337f5a3d49.tar.bz2
busybox-w32-5233cd38003724fad3b4355174d367337f5a3d49.zip
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
-rw-r--r--include/applets.h1
-rw-r--r--include/usage.h9
-rw-r--r--miscutils/Config.in60
-rw-r--r--miscutils/Kbuild1
4 files changed, 71 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h
index 90b6e703d..1c654cdd6 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -93,6 +93,7 @@ USE_BZIP2(APPLET(bzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
93USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 93USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
94USE_CAT(APPLET_NOFORK(cat, cat, _BB_DIR_BIN, _BB_SUID_NEVER, cat)) 94USE_CAT(APPLET_NOFORK(cat, cat, _BB_DIR_BIN, _BB_SUID_NEVER, cat))
95USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER)) 95USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER))
96USE_CHAT(APPLET(chat, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
96USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER)) 97USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER))
97USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 98USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
98USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) 99USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp))
diff --git a/include/usage.h b/include/usage.h
index d1878827b..0422c7fcf 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -204,6 +204,15 @@ USE_FEATURE_BRCTL_FANCY("\n" \
204 " -e End each line with $\n" \ 204 " -e End each line with $\n" \
205 " -t Show tabs as ^I\n" \ 205 " -t Show tabs as ^I\n" \
206 " -v Don't use ^x or M-x escapes" 206 " -v Don't use ^x or M-x escapes"
207
208#define chat_trivial_usage \
209 "EXPECT [SEND [EXPECT [SEND...]]]"
210#define chat_full_usage \
211 "Useful for interacting with a modem connected to stdin/stdout.\n" \
212 "A script consists of one or more \"expect-send\" pairs of strings,\n" \
213 "each pair is a pair of arguments. Example:\n" \
214 "chat '' ATZ OK ATD123456 CONNECT '' ogin: pppuser word: ppppass '~'" \
215
207#define chattr_trivial_usage \ 216#define chattr_trivial_usage \
208 "[-R] [-+=AacDdijsStTu] [-v version] files..." 217 "[-R] [-+=AacDdijsStTu] [-v version] files..."
209#define chattr_full_usage \ 218#define chattr_full_usage \
diff --git a/miscutils/Config.in b/miscutils/Config.in
index d64d05345..9df1b0e85 100644
--- a/miscutils/Config.in
+++ b/miscutils/Config.in
@@ -19,6 +19,66 @@ config BBCONFIG
19 The bbconfig applet will print the config file with which 19 The bbconfig applet will print the config file with which
20 busybox was built. 20 busybox was built.
21 21
22config CHAT
23 bool "chat"
24 default n
25 help
26 Simple chat utility.
27
28config FEATURE_CHAT_NOFAIL
29 bool "Enable NOFAIL expect strings"
30 default y
31 help
32 When enabled expect strings which are started with a dash trigger
33 no-fail mode. That is when expectation is not met within timeout
34 the script is not terminated but sends next SEND string and waits
35 for next EXPECT string. This allows to compose far more flexible
36 scripts.
37
38config FEATURE_CHAT_TTY_HIFI
39 bool "Force STDIN to be a TTY"
40 default n
41 help
42 Original chat always treats STDIN as a TTY device and sets for it
43 so-called raw mode. This option turns on such behaviour.
44
45config FEATURE_CHAT_IMPLICIT_CR
46 bool "Enable implicit Carriage Return"
47 default y
48 help
49 When enabled make chat to terminate all SEND strings with a "\r"
50 unless "\c" is met anywhere in the string.
51
52config FEATURE_CHAT_SWALLOW_OPTS
53 bool "Swallow options"
54 default n
55 help
56 Busybox chat require no options. To make it not fail when used
57 in place of original chat (which has a bunch of options) turn
58 this on.
59
60config FEATURE_CHAT_SEND_ESCAPES
61 bool "Support weird SEND escapes"
62 default n
63 help
64 Original chat uses some escape sequences in SEND arguments which
65 are not sent to device but rather performs special actions.
66 E.g. "\K" means to send a break sequence to device.
67 "\d" delays execution for a second, "\p" -- for a 1/100 of second.
68 Before turning this option on think twice: do you really need them?
69
70config FEATURE_CHAT_VAR_ABORT_LEN
71 bool "Support variable-length ABORT conditions"
72 default n
73 help
74 Original chat uses fixed 50-bytes length ABORT conditions. Say N here.
75
76config FEATURE_CHAT_CLR_ABORT
77 bool "Support revoking of ABORT conditions"
78 default n
79 help
80 Support CLR_ABORT directive.
81
22config CHRT 82config CHRT
23 bool "chrt" 83 bool "chrt"
24 default n 84 default n
diff --git a/miscutils/Kbuild b/miscutils/Kbuild
index a9dc833e6..51187c556 100644
--- a/miscutils/Kbuild
+++ b/miscutils/Kbuild
@@ -7,6 +7,7 @@
7lib-y:= 7lib-y:=
8lib-$(CONFIG_ADJTIMEX) += adjtimex.o 8lib-$(CONFIG_ADJTIMEX) += adjtimex.o
9lib-$(CONFIG_BBCONFIG) += bbconfig.o 9lib-$(CONFIG_BBCONFIG) += bbconfig.o
10lib-$(CONFIG_CHAT) += chat.o
10lib-$(CONFIG_CHRT) += chrt.o 11lib-$(CONFIG_CHRT) += chrt.o
11lib-$(CONFIG_CROND) += crond.o 12lib-$(CONFIG_CROND) += crond.o
12lib-$(CONFIG_CRONTAB) += crontab.o 13lib-$(CONFIG_CRONTAB) += crontab.o