Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Suppress stdout #28

Closed
jonpither opened this issue Apr 15, 2017 · 4 comments
Closed

Suppress stdout #28

jonpither opened this issue Apr 15, 2017 · 4 comments

Comments

@jonpither
Copy link
Member

In Mach we have this tag literal #$ which does a shell from your Machfile (think Makefile) - i.e. #$ ["touch" "foo"]. It's cool.

Sometimes though you want to print the output stdout (as happens always now) but sometimes it's annoying and you want to suppress it.

Does an idiom shout out for this? For example we could add a new tag literal which is a quiet version... or change the contract of the literal to supply args... or add a Mach -v flag for verbose.

Thoughts welcome.

@arichiardi
Copy link
Contributor

I'd do it per tag literal, as -v seems more useful when you want to debug your scripts (you log using console.log). Definitely worth having the feature.

@jonpither
Copy link
Member Author

jonpither commented Apr 17, 2017

Thanks. Perhaps a new literal #@$ to suppress std out?

Since ec92007 the stdout and stderr from the shell process is redirected to the channels of the parent, mach process. This new literal would simply mute the outputs.

There is another thing printed currently, which is the actual command. The new literal could mute that too for simplicity.

@jonpither
Copy link
Member Author

jonpither commented Apr 17, 2017

Or we simply allow users to call mach.core/sh and pass through opts if they want more control over what happens. This seems sensible to me.

@arichiardi
Copy link
Contributor

The latter seems ok, probably no need to introduce a new literal...it seems fair to use the function directly if you need more fine tuning.

jonpither added a commit that referenced this issue Aug 30, 2017
      - Breaking change
      - Fixes #28
jonpither added a commit that referenced this issue Aug 30, 2017
Make shell take opts, fixes #28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants