@brief An "additional parser" for Boost.Program_options that will turn any --hide-xyz into --show-xyz false
| 40 | /// @brief An "additional parser" for Boost.Program_options that will turn |
| 41 | /// any --hide-xyz into --show-xyz false |
| 42 | inline std::pair<std::string, std::string> |
| 43 | convertHideIntoFalseShow(const std::string &s) { |
| 44 | static const char hidePrefix[] = "--hide"; |
| 45 | static const char showPrefix[] = "show"; |
| 46 | if (s.find(hidePrefix) == 0) { |
| 47 | return std::make_pair(showPrefix + s.substr(sizeof(hidePrefix) - 1), |
| 48 | std::string("false")); |
| 49 | } |
| 50 | return std::make_pair(std::string(), std::string()); |
| 51 | } |
| 52 | } // namespace util |
| 53 | } // namespace osvr |
| 54 |