Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative piping syntax #10

Open
Mihailoff opened this issue Oct 29, 2014 · 1 comment
Open

Alternative piping syntax #10

Mihailoff opened this issue Oct 29, 2014 · 1 comment

Comments

@Mihailoff
Copy link
Contributor

echo sh::grep('html', sh::curl('http://example.com', array(
    'location' => true
)));

In current API I don't like 2 things:

  1. inverted order of commands (grep -> curl) when actually curl | grep is intended
  2. "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?

@MrRio
Copy link
Owner

MrRio commented Nov 7, 2014

Yeah I like that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants