3 ms·
I'd argue that wrapping crappy syntax is decent syntax is 90% of what tools do.
by roguecoder 14y ago
I'd argue that wrapping crappy syntax is decent syntax is 90% of what tools do.
- zobzu 14y agoI often write wrapper scripts to make complex syntax simple. Just for me. Don't get me wrong. i actually _know_ the f* syntax because I'm and old crazy fart like that by now. But when it comes to use it, it takes a while to type. Sometimes I make typos. Sometimes i forget one specific option or character and I gotta look in man again. The simplified syntax wrappers make it f' easy. The other day I made a csv column grepper. It just calls awk and assign numbers to column names, so i can just grep by column names no matter their order. So yeah, a huge line of awk can do it. An even less understandable line of grep can actually do that too. Some other tools as well. Mine is just ./supertool colname colname colname ... | awk "$2 != blah" |column -t (For the record, there were similar wrappers in python and perl, each of which were 5 to 35x slower (200 to 1000 lines script) than my 20 lines bash script, which is another complain I have. Reimplementing that stuff in high level languages is generally a bad idea, specially when you don't understand what happens underneath.