aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/eol.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/eol.lua b/etc/eol.lua
new file mode 100644
index 0000000..234cc4d
--- /dev/null
+++ b/etc/eol.lua
@@ -0,0 +1,9 @@
1marker = {['-u'] = '\10', ['-d'] = '\13\10'}
2arg = arg or {'-u'}
3marker = marker[arg[1]] or marker['-u']
4local convert = socket.code.canonic(marker)
5while 1 do
6 local chunk = io.read(4096)
7 io.write(convert(chunk))
8 if not chunk then break end
9end