Project: mesos
Issue MESOS-4576: Introduce a stout helper for "which"
We may want to add a helper to {{stout/os.hpp}} that will natively emulate the functionality of the Linux utility {{which}}. i.e. {code} Option which(const string& command) { Option path = os::getenv("PATH"); // Loop through path and return the first one which os::exists(...). return None(); } {code} This helper may be useful: * for test filters in {{src/tests/environment.cpp}} * a few tests in {{src/tests/containerizer/port_mapping_tests.cpp}} * the {{sha512}} utility in {{src/common/command_utils.cpp}} * as runtime checks in the {{LogrotateContainerLogger}} * etc.
Story points: 2