Page MenuHomePhabricator

Suppress stdin message if input is piped
ClosedPublic

Authored by joshuaspence on Jan 1 2015, 12:22 PM.
Tags
None
Referenced Files
F14036236: D11122.diff
Sun, Nov 10, 9:15 AM
F14010963: D11122.id26700.diff
Thu, Oct 31, 2:21 PM
F13987808: D11122.diff
Mon, Oct 21, 11:24 AM
F13971229: D11122.id26741.diff
Thu, Oct 17, 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
Unknown Object (File)
Sep 15 2024, 2:26 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
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3449
Build 3456: [Placeholder Plan] Wait for 30 Seconds

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.