Page MenuHomePhabricator

Suppress stdin message if input is piped
ClosedPublic

Authored by joshuaspence on Jan 1 2015, 12:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 2:58 AM
Unknown Object (File)
Sun, Nov 10, 9:15 AM
Unknown Object (File)
Thu, Oct 31, 2:21 PM
Unknown Object (File)
Oct 21 2024, 11:24 AM
Unknown Object (File)
Oct 17 2024, 12:24 PM
Unknown Object (File)
Oct 2 2024, 1:24 AM
Unknown Object (File)
Sep 20 2024, 10:34 AM
Unknown Object (File)
Sep 15 2024, 2:27 AM
Subscribers

Details

Summary

Currently we output "Waiting for JSON parameters on stdin...", even if stdin is piped (for example, from echo).

Test Plan
> echo '{}' | arc call-conduit conduit.ping
{"error":null,"errorMessage":null,"response":"ip-10-161-81-110"}

> arc call-conduit conduit.ping
Waiting for JSON parameters on stdin...
{}
^D
{"error":null,"errorMessage":null,"response":"ip-10-161-81-110"}

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Suppress stdin message if input is piped.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

I believe we don't require posix, and I don't want to require it. You can do this:

if (!function_exists('posix_isatty') || posix_isatty(STDIN)) {
  // print message
}
This revision now requires changes to proceed.Jan 1 2015, 2:35 PM
joshuaspence edited edge metadata.

Don't require the POSIX extension

epriestley edited edge metadata.
This revision is now accepted and ready to land.Jan 1 2015, 11:27 PM
This revision was automatically updated to reflect the committed changes.