morloc-project / morloc

A typed, polyglot, functional language
GNU General Public License v3.0
195 stars 4 forks source link

Feature Request: standard input #6

Closed j23414 closed 9 months ago

j23414 commented 4 years ago

Might be nice to accept standard input if the function takes a single argument, or use '-' to stand in for standard in?

arendsee commented 4 years ago

Good point. I'll try to add this in the next release, probably in a couple weeks.

arendsee commented 3 years ago

I haven't forgotten this. I'll try to add when I get around to starting a UI-centered dev-cycle.

arendsee commented 9 months ago

Commands can now take JSON files as inputs rather than raw JSON strings. So now you can use standard input by reading from the /dev/stdin file. This will allow you to pass the output of one morloc program to a second morloc program as a positional argument.

This does not exactly address your issue, though. The files morloc accepts must be JSON files that specify a morloc object. Files are assumed to be structured. So piping arbitrary strings into morloc will not work. You can write your entire pipeline as a morloc composition, though. Part of the reason for creating morloc was to replace brittle Bash scripting.