ur0 / lolcat

lolcat, now with fearless concurrency.
MIT License
99 stars 14 forks source link

Word wrap #27

Open magnus-ISU opened 1 year ago

magnus-ISU commented 1 year ago

I am not going to merge this yet because it makes a potentially very undesirable change: It makes lolcat automatically wrap words. Words are defined as space-separated strings. So

$ echo words that are awesome and very cool and all on one line including one super long word: aoeushaeoshusaohueoahush > test_file
$ lolcat --terminal-size 10 test_file

prints

words 
that are 
awesome 
and very 
cool and 
all on 
one line 
including
one super
long 
word: 
aoeushaeo
shusaohue
oahush

lolcat is about printing (fun) things for humans. So I think reflowing output is not necessarily a bad thing. But it may be very different from what is expected for a drop-in replacement for the original lolcat. Therefore it might be wiser to put it behind a -w flag to turn it on.

However, I think also that making useful upgrades require random command-line flags to turn on is silly and a big part of why people love ripgrep and bat and exa etc.

I do think that the only output which this particularly breaks is probably already broken though. So I am in favor of it myself, just don't want to make such a change randomly.

Therefore, I am conflicted. I would like feedback on whether this should be merged or not. @ur0