From 7fcd90b39ce63f282d5498c06f78118bc03acf18 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 14 Feb 2015 14:05:00 -0600 Subject: Split out unix2dos so scripts/single.sh and "make change" can build it standalone. --- toys/other/dos2unix.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/toys/other/dos2unix.c b/toys/other/dos2unix.c index 690c5a8e..021ba384 100644 --- a/toys/other/dos2unix.c +++ b/toys/other/dos2unix.c @@ -2,16 +2,25 @@ * * Copyright 2012 Rob Landley -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 between dos (\r\n) and unix (just \n) + Convert newline format from dos "\r\n" to unix "\n". + If no files listed copy from stdin, "-" is a synonym for stdin. + +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 @@ void dos2unix_main(void) { loopfiles(toys.optargs, do_dos2unix); } + +void unix2dos_main(void) +{ + dos2unix_main(); +} -- cgit v1.2.3