echo sh::grep('html', sh::curl('http://example.com', array(
'location' => true
)));
In current API I don't like 2 things:
- inverted order of commands (grep -> curl) when actually
curl | grep is intended
- "wrap" or functional style a(b(c()))
It would be nice to have fluid API like this
sh::curl('http://example.com')->pipe('grep', 'html')->pipe('whatever');
or
sh::curl('http://example.com')->sh('grep', 'html')->sh('whatever');
or
sh::curl('http://example.com')->grep('html')->whatever();
@MrRio what do you think?