! Copyright (C) 2009 Anthony Simpson. USING: kernel namespaces sequences command-line io.files io.encodings.utf8 io accessors ; IN: wnlc TUPLE: cmdargs os-conf files ; C: cmdargs : convert ( seq -- seq ) [ CHAR: \r = not ] filter ; : read-file ( path -- seq ) utf8 file-contents ; : write-file ( seq path -- ) utf8 set-file-contents ; : doconvert ( cmdargs -- ) files>> [ dup read-file convert swap write-file ] each ; : cmdwork ( -- cmdargs ) (command-line) dup first swap rest ; : main ( -- ) cmdwork doconvert ; MAIN: main