changeset 1695:3d1b78e5e066 draft

Split out unix2dos so scripts/single.sh and "make change" can build it standalone.
author Rob Landley <rob@landley.net>
date Sat, 14 Feb 2015 14:05:00 -0600
parents a5901bfefda5
children f18d0a08b471
files toys/other/dos2unix.c
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/toys/other/dos2unix.c	Sat Feb 14 01:08:15 2015 -0600
+++ b/toys/other/dos2unix.c	Sat Feb 14 14:05:00 2015 -0600
@@ -2,16 +2,25 @@
  *
  * Copyright 2012 Rob Landley <rob@landley.net>
 
-USE_DOS2UNIX(NEWTOY(dos2unix, NULL, TOYFLAG_BIN))
-USE_DOS2UNIX(OLDTOY(unix2dos, dos2unix, TOYFLAG_BIN))
+USE_DOS2UNIX(NEWTOY(dos2unix, 0, TOYFLAG_BIN))
+USE_UNIX2DOS(NEWTOY(unix2dos, 0, TOYFLAG_BIN))
 
 config DOS2UNIX
   bool "dos2unix/unix2dos"
   default y
   help
-    usage: dos2unix/unix2dos [file...]
+    usage: dos2unix [FILE...]
+
+    Convert newline format from dos "\r\n" to unix "\n".
+    If no files listed copy from stdin, "-" is a synonym for stdin.
 
-    Convert newline format between dos (\r\n) and unix (just \n)
+config UNIX2DOS
+  bool "unix2dos"
+  default y
+  help
+    usage: unix2dos [FILE...]
+
+    Convert newline format from unix "\n" to dos "\r\n".
     If no files listed copy from stdin, "-" is a synonym for stdin.
 */
 
@@ -60,3 +69,8 @@
 {
   loopfiles(toys.optargs, do_dos2unix);
 }
+
+void unix2dos_main(void)
+{
+  dos2unix_main();
+}