8 ms·
Great to have alternatives, but wish there was a “Why” section in readme
by Simplicitas 3y ago
Great to have alternatives, but wish there was a “Why” section in readme
- imoverclocked 3y agoRight, does it do things faster? Or somehow more efficiently? It seems that this is probably slower and consumes far more resources than cat. It also does pretty printing and syntax highlighting. From a Unix standpoint, I would say this is not a cat replacement but a pretty replacement.
- 5e92cb50239222b 3y agoI just tried both gat and bat to see if they could really replace cat (spoiler: they cannot — unlike cat they soak up all input before outputting anything, and crash with out of memory very quickly). A cat alternative would have to handle this correctly: $ </dev/zero cat >/dev/null or it's not really a cat alternative. (Yes, variations on this theme are very useful in scripts and daily shell hacking).
- Fire-Dragon-DoL 3y agoWow, I would expect handling streaming properly to be the default case
- morelisp 3y agoThat's wild given that Go makes it harder to read a whole file than read a block at a time.
- nasretdinov 3y agoOh, absolutely not! ioutil.ReadFile and you're done!
- Patrickmi 3y agoAt least we know the problem and the solution to it
- skulk 3y agoHere is where the file is read in its entirety. https://github.com/koki-develop/gat/blob/c16dbf999b89b46ed17f5acf94e2250a97b8dcfc/pkg/printer/printer.go#L85-L88 https://github.com/koki-develop/gat/blob/c16dbf999b89b46ed17...