People are people too.
Hardly anybody will be interested in this, but I'm posting it anyway. At the very least, this should prove to you I'm not sitting on my hands all the time.
Today, I finally got sick and tired of the old word wrapping program we've been using around the MMN. I wrote it back when I was first learning C, and while it was somewhat fast (compared to some alternatives) it was a little clunky in some spots, and downright buggy in others. (Choked on input texts > 2GB, needed to fit entire text in RAM, etc..)
Like I said, I got sick of it, so I wrote a new one. Go ahead, it's GPL'd, so feel free to use it. It definitely runs fine on Linux and MacOS X and I can't imagine any good reason why it wouldn't run under Windows if compiled with cygwin or MingW.
My program, Wrap, is a bit more featureful than GNU fold, but is a tiny bit slower. (Although the benchmarking process wasn't very comprehensive, so I guess the jury's still out.)
The main practical difference between Wrap and fold, as far as I can tell, is that Wrap has a multitude of options for changing the behavior of the word wrapping algorithm. Want to cut words at the maximum line width? Check. Want to wrap words at spaces and tabs? Check. Want to allow long strings (such as URLs) to violate the maximum line width rule? Check. Want to allow wrapping at hyphens and dashes in addition to spaces? Check. Want to change how wide tabs are assumed to be? Check.
Aside from all the other little improvements, one of Wrap's most interesting capabilities is a very powerful batch-processing feature which allows you to wrap any combination of input files to any combination of output files, with different combinations of parameters, all in one run. The value of this could be debatable, but it seemed like a good idea at the time, so I put it in.
Of course it also supports the usual, like: reasonably complete support of so-called "wide" characters such as Unicode multibyte sequences, full support of STDIN and STDOUT as source and destination, (apparently) correct calculation of the proper width of a tab character in the context of the rest of the line.
Anyway, I somehow doubt anybody's going to find this useful, but there it is.
ttyl
--Alex
Comments
Nice
Keep up the good work!
-------
“... But as for me, I trust in [God.]” -Psalm 55:23
With contentment comes passion to make the best of opportunity.
You're right
I'm proud of you, even if I don't understand you.
---------------
I get up, I walk, I fall down. Meanwhile, I keep dancing. - Hillel
---------------
Fairy tales are more than true — not because they tell us dragons exist, but because they tell us dragons can be beaten. - G. K. Chesterton